From 0795b0d4d0640f99efb1ea4c91059f9e4332fdfa Mon Sep 17 00:00:00 2001 From: thecodrr Date: Tue, 8 Dec 2020 12:23:35 +0500 Subject: [PATCH] fix: make sure note.notebooks have topics instead of topic --- .../__tests__/__fixtures__/backup.v4.2.json | 1 + packages/core/__tests__/backup.test.js | 20 ++++++++++-------- packages/core/common.js | 2 +- packages/core/database/backup.js | 4 +++- packages/core/migrations.js | 21 ++++++++++++++----- 5 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 packages/core/__tests__/__fixtures__/backup.v4.2.json diff --git a/packages/core/__tests__/__fixtures__/backup.v4.2.json b/packages/core/__tests__/__fixtures__/backup.v4.2.json new file mode 100644 index 000000000..387917f43 --- /dev/null +++ b/packages/core/__tests__/__fixtures__/backup.v4.2.json @@ -0,0 +1 @@ +{"version":4.2,"type":"web","date":1607411514757,"data":{"072e629fbb1300eadf2443f8":{"noteId":"eb077a9f82c2a6c5fa69111e","id":"072e629fbb1300eadf2443f8","type":"delta","data":[{"insert":"I am googling.\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847640,"dateCreated":1604648692525},"0820cee001cb18c206324b53":{"id":"0820cee001cb18c206324b53","deleted":true,"dateCreated":1605958164096,"dateEdited":1607410847604},"088bc2c47c76afc39d0aaed5":{"type":"tag","id":"088bc2c47c76afc39d0aaed5","title":"green","noteIds":["64f2598b3140adf6ce66688f","c8a91d5bb5ca50df1c0faa5c","4e6a0dcd9f2238c825f89878","787ee8c0508aac3ba5492751","32b69f0b788847af4af763b4","fac860e01d89026efdc6d29b","169786b13fd7aaee76e2725d"],"deletedIds":["4e6a0dcd9f2238c825f89878","787ee8c0508aac3ba5492751","32b69f0b788847af4af763b4","fac860e01d89026efdc6d29b","169786b13fd7aaee76e2725d"],"dateEdited":1607410847616},"0959cca9f57ca18a70bb5d5f":{"id":"0959cca9f57ca18a70bb5d5f","deleted":true,"dateCreated":1604808745447,"dateEdited":1607410847624},"0bc2b63838a8eca4a142734b":{"noteId":"574169433cb3768301b92071","id":"0bc2b63838a8eca4a142734b","type":"delta","data":{"noteId":"574169433cb3768301b92071","id":"0bc2b63838a8eca4a142734b","conflicted":false,"resolved":false,"dateEdited":1604648616022,"dateCreated":1602738310773,"remote":true,"type":"delta"},"conflicted":false,"resolved":false,"dateEdited":1607410847640,"dateCreated":1602738310773},"134dce90b0cffefcfd476560":{"id":"134dce90b0cffefcfd476560","contentId":"9ca42fca695a95f45b755b09","type":"note","title":"Instagram Daily Prompt #2 - Winners","headline":"@whitewr_ites\nAnd those were the days when my eyes were hidden beneath the charcoal of anger and never ending hatred gushing the wave of shrillness an...","pinned":false,"locked":false,"color":"gray","tags":[],"favorite":false,"dateCreated":1603255571603,"conflicted":false,"dateEdited":1607410847604},"14e7b576bc9022eca6ac3b8f":{"noteId":"f053ed3e1981efc0baf1a939","id":"14e7b576bc9022eca6ac3b8f","type":"delta","data":[{"insert":"Steps:\nUser presses enable 2fa"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"User is presented with 2 options: 1. SMS 2fa and 2. 2fa via App"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"If user chooses option 2:"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"User is presented with 10-20 recovery codes with options to download, print and copy the codes."},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"Present user a barcode and a text string to enter into the app"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"Let user enter the 6 digit code from the Authenticator App"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"and done"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"If user chooses option 1"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"let user enter their phone number and send them a text"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"the user enters the code they received and done."},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847641,"dateCreated":1603464664187},"169786b13fd7aaee76e2725d":{"id":"169786b13fd7aaee76e2725d","contentId":"87a334a0dd1521758b26f839","type":"note","title":"I am a topic note","headline":"Yes I am a topic note. What are you going to be doing eh? It has been so long. I","pinned":true,"locked":false,"tags":["topic\\","luck"],"favorite":false,"dateCreated":1604648910803,"conflicted":false,"dateEdited":1607410847604},"18265107ac5466dcc98229c4":{"id":"18265107ac5466dcc98229c4","deleted":true,"dateEdited":1607410847622,"dateCreated":1604808745473},"1e1a998dd339b35f3cd49432":{"id":"1e1a998dd339b35f3cd49432","contentId":"d28b39abf684fb36fd6d89c5","type":"note","title":"Notesnook Website","headline":"1. Note apps are too complex Sometimes all you want to do is take a note. You do","pinned":false,"locked":false,"tags":[],"favorite":false,"dateCreated":1606997006027,"conflicted":false,"dateEdited":1607410847605},"1f72a3613005e058b6f90a65":{"noteId":"de09b0123546245555f2c4f1","id":"1f72a3613005e058b6f90a65","type":"delta","data":[{"insert":"Writing Quotes"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"https://writingcooperative.com/18-motivational-quotes-to-bring-out-the-writer-in-you-ea3e61c93734"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"https://blog.reedsy.com/writing-quotes/"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"https://www.goodreads.com/quotes/tag/writing"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"Writing Prompts"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"We can do a 100+ writing prompt blog post and use ideas from our Discord Daily Prompts"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"Writing Styles"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"https://www.grammarly.com/blog/writing-styles/"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"Writing Process"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"https://www.grammarly.com/blog/writing-process/"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"http://writing.ku.edu/writing-process"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"https://www.time4writing.com/writing-resources/writing-process/"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"Writing Apps"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"https://blog.reedsy.com/writing-apps/"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"http://becomeawritertoday.com/writing-apps/"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"https://getcodeless.com/best-writing-apps/"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"https://prowritingaid.com/art/26/10-Free-Writing-Apps-and-Tools.aspx"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"Writing Tips"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"https://www.grammarly.com/blog/writing-tips/"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"https://www.smashingmagazine.com/2009/06/50-free-resources-that-will-improve-your-writing-skills/"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"Poetry Types"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"https://bookriot.com/different-types-of-poems/"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"https://examples.yourdictionary.com/types-of-poetry-examples.html"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"Affect vs Effect"},{"attributes":{"list":"ordered"},"insert":"\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847641,"dateCreated":1603531223455},"20f49206c149e51261e5a409":{"id":"20f49206c149e51261e5a409","deleted":true,"dateCreated":1606946783282,"dateEdited":1607410847625},"220dcc97dbcd80220932c670":{"id":"220dcc97dbcd80220932c670","deleted":true,"dateEdited":1607410847622,"dateCreated":1604808745467},"2e1288e52e41ecef63a36819":{"id":"2e1288e52e41ecef63a36819","deleted":true,"dateEdited":1607410847605,"dateCreated":1604159344560},"32b69f0b788847af4af763b4":{"id":"32b69f0b788847af4af763b4","contentId":"8f1699d6cfe9e0708ad73746","type":"note","title":"Job as a Blog Manager","headline":"Daily tasks to handle: Obtaining the blog post from the writ","pinned":false,"locked":false,"color":"orange","tags":[],"favorite":false,"dateCreated":1605958249410,"conflicted":false,"dateEdited":1607410847606},"3ef180968f57780da0633e60":{"type":"tag","id":"3ef180968f57780da0633e60","title":"topic\\","noteIds":["169786b13fd7aaee76e2725d"],"deletedIds":[],"dateCreated":1607407264875,"dateEdited":1607410847615},"417003805f96cfd3682ff444":{"id":"417003805f96cfd3682ff444","deleted":true,"dateCreated":1606417966684,"dateEdited":1607410847606},"43ae73c5dd74646bf1d69725":{"noteId":"787ee8c0508aac3ba5492751","id":"43ae73c5dd74646bf1d69725","type":"delta","data":[{"insert":"I used to stand on the edge of the hill and gaze at the horizon with wistful eyes. I dreamed of reaching the sun. Every day my quest remained a quest, my wish, a wish. \nMy story is no different. I am human. I hurt. I cry. I beg. I do all the things that you do. I have good days and bad days, best days and worst days. I also cannot sleep some nights. I also feel lonely and depressed. I care, I love, I laugh, and I celebrate.\nWhat is happening to me? My heart lays against the walls of my prison shredded. I am no heartbroken angel, nor a demon cast from hell. Nay, I am but human, soft and fragile, vulnerable to thy daggers, open to thy jibes.\nThey laugh at me when I smile, my jagged teeth resemble the broken gears of an 18th century clock. My hands are burned, not fair like yours, my face is scarred, and my heart lives in a cage. What remains is just an imitation, a farce upon the sands of time.\nI can wail and cry, and bang my head against these walls but it won't fix what's broken. The dagger in my heart is of betrayal, of scorn and belittled regard. The weary way in which my eyes roll and dance tells my story. Am I too sensitive to words not mine?\nWhat remains is dust when the hour strikes. What breaks is life, when the words collide. I seek no solace in the hearts of others. But I also do not ask for them to break mine.\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847642,"dateCreated":1606082023316},"459e1d37d42d28b980216f98":{"id":"459e1d37d42d28b980216f98","deleted":true,"dateEdited":1607410847623,"dateCreated":1604808745464},"4e6a0dcd9f2238c825f89878":{"id":"4e6a0dcd9f2238c825f89878","contentId":"e9c257f2c74a50c34b668684","type":"note","title":"And then I woke up","headline":"In the middle of a sound I woke up. A scream hung between my teeth. I looked aro","pinned":false,"locked":false,"notebooks":[{"id":"da4e12448d8e1603348782e1","topic":"f54275080ed7c12082e8054d"}],"color":"red","tags":[],"favorite":false,"dateCreated":1606417970481,"conflicted":false,"dateEdited":1607410847607},"574169433cb3768301b92071":{"id":"574169433cb3768301b92071","contentId":"0bc2b63838a8eca4a142734b","type":"note","title":"Google Keep","headline":"","pinned":false,"locked":true,"color":"red","tags":[],"favorite":true,"dateCreated":1602738310789,"conflicted":false,"dateEdited":1607410847607},"5866d6900e437a6280bfdb9d":{"noteId":"ca81622cb6b84b2d43847e23","id":"5866d6900e437a6280bfdb9d","type":"delta","data":[],"conflicted":false,"resolved":false,"dateEdited":1607410847643,"dateCreated":1604167981443},"5c563ed161509ffb24178436":{"id":"5c563ed161509ffb24178436","contentId":"e793233cf5af7ca88f8e6678","type":"note","title":"Hello world","headline":"Hello world\n","pinned":false,"locked":false,"tags":[],"favorite":false,"dateCreated":1604559589527,"conflicted":false,"dateEdited":1607410847607},"61c38224dd2b3fbd7f7e0b91":{"noteId":"ade2ec88c6c5e313dcdafece","id":"61c38224dd2b3fbd7f7e0b91","type":"delta","data":[{"insert":"@_penitdown._\nAlthough strength is a shield, recurrent indignation cause fatigue.\n\n@ashwinidodani\nBeyond fatigue, lies a garden full of new beginnings, the one we could never visualize while we felt exhausted.\n\n@roseycloudy\nNights of fatigue and disarray emerge as this heartbreak reaches its crescendo.\n\n@metaphorphosis_\nTime stands fatigued against the wall, as the lovers share a kiss for a minute that took forever.\n\n@thewordictedd\nThe fatigue in my chest feels the way the earth-devoured legs feel after running in endless circles in quicksand.\n\n@the_untitled_journal\nIn the splatter of mental rain, I lay fatigued by the quirks of my idle mind.\n\n@the_greentypewriter\nAncient trees whisper to dryads and demons, for the long fatigued Earth is finally awakening.\n\n@philopoetra\nThe blooming fatigue of my crimson petals scenting silhouettes of hues into your soul.\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847643,"dateCreated":1603170822859},"64f2598b3140adf6ce66688f":{"id":"64f2598b3140adf6ce66688f","contentId":"a76badb6ef0e6d2e8a59ce09","type":"note","title":"Main Topics","headline":"Self-love - 11\nNostalgia - 4\nWriting - 3\nDiscrimination/Equality - 2\nDepression/Loneliness/Misery/Pain - 16 \nWomen empowerment/women abuse/domestic ab...","pinned":false,"locked":false,"color":"green","tags":[],"favorite":false,"dateCreated":1602747191551,"conflicted":false,"dateEdited":1607410847608},"657ba6d335001b0d790392f1":{"noteId":"c8a91d5bb5ca50df1c0faa5c","id":"657ba6d335001b0d790392f1","type":"delta","data":[{"insert":"I am lying in a cesspool covered in rags I borrowed from a whorehouse. My downfall has come in Cimmerian robes reminding me that I am no more. I feel cat paws on my broken ribs, and sharp beaks tearing my flesh, but I feel nothing. I am prey for the creatures of Night, a whore for monsters to use, a bastard born in Solitude, an apparition from my darkest nightmares, with a rotting core and a dying heart. I have forgotten my name in t\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847644,"dateCreated":1605811000354},"65a0ec62f1f629f914aa3d3b":{"type":"tag","id":"65a0ec62f1f629f914aa3d3b","title":"luck","noteIds":["169786b13fd7aaee76e2725d"],"deletedIds":[],"dateCreated":1607407268809,"dateEdited":1607410847616},"65bf9f76fa511ef015621462":{"type":"tag","id":"65bf9f76fa511ef015621462","title":"blue","noteIds":["6c1e7f277554ae204683b105","787ee8c0508aac3ba5492751","169786b13fd7aaee76e2725d","4e6a0dcd9f2238c825f89878","bfcb57c4c522954b5f215a80"],"deletedIds":["169786b13fd7aaee76e2725d","4e6a0dcd9f2238c825f89878","bfcb57c4c522954b5f215a80"],"dateEdited":1607410847617},"6a5e1d598ba3a1caf58d57cf":{"type":"tag","id":"6a5e1d598ba3a1caf58d57cf","title":"red","noteIds":["ade2ec88c6c5e313dcdafece","574169433cb3768301b92071","169786b13fd7aaee76e2725d","4e6a0dcd9f2238c825f89878","787ee8c0508aac3ba5492751","1e1a998dd339b35f3cd49432"],"deletedIds":["4e6a0dcd9f2238c825f89878","787ee8c0508aac3ba5492751","1e1a998dd339b35f3cd49432"],"dateEdited":1607410847617},"6a8df957481c3111e38c940d":{"type":"tag","id":"6a8df957481c3111e38c940d","title":"gray","noteIds":["134dce90b0cffefcfd476560","169786b13fd7aaee76e2725d","4e6a0dcd9f2238c825f89878"],"deletedIds":["169786b13fd7aaee76e2725d","4e6a0dcd9f2238c825f89878"],"dateEdited":1607410847617,"dateCreated":1607349082607},"6c1e7f277554ae204683b105":{"id":"6c1e7f277554ae204683b105","contentId":"d2163186f1150336060627ae","type":"note","title":"Streetwriters API Authentication Procedure","headline":"The Current Procedure:\nUser sends his username and password for authentication and verification.\nThe server hashes the password and if the hashes matc...","pinned":false,"locked":false,"color":"blue","tags":[],"favorite":false,"dateCreated":1601979248657,"conflicted":false,"dateEdited":1607410847608},"6e3acc37b1116ae4f31ee504":{"type":"tag","id":"6e3acc37b1116ae4f31ee504","title":"orange","noteIds":["1e1a998dd339b35f3cd49432","32b69f0b788847af4af763b4"],"deletedIds":[],"dateEdited":1607410847618},"76e62846a22186530774a0e6":{"id":"76e62846a22186530774a0e6","deleted":true,"dateCreated":1607344893551,"dateEdited":1607410847618},"787ee8c0508aac3ba5492751":{"id":"787ee8c0508aac3ba5492751","contentId":"43ae73c5dd74646bf1d69725","type":"note","title":"When it strikes","headline":"I used to stand on the edge of the hill and gaze at the horizon with wistful eye","pinned":false,"locked":false,"color":"blue","tags":[],"favorite":false,"dateCreated":1606082023351,"conflicted":false,"dateEdited":1607410847609},"798a465fac0fb85c44443bfd":{"id":"798a465fac0fb85c44443bfd","deleted":true,"dateCreated":1607346896599,"dateEdited":1607410847619},"8551d4a44017d0be7246b383":{"id":"8551d4a44017d0be7246b383","deleted":true,"dateCreated":1604808745447,"dateEdited":1607410847626},"875494a35855bce8012055b6":{"noteId":"bfcb57c4c522954b5f215a80","id":"875494a35855bce8012055b6","type":"delta","data":{"cipher":"wQ3k4a33R2cDljq8HMJdpg2lnb4zijHOARx52vJVA7tq3uXE-Kt38VOSYuYLLg-IfAtxfP9B5TUBug75yoW_LIanKmKrkNSW0dkgcG06KAY4L9ax0cPb5quQN88KlI_-zRiFK_E-9l__02yAFQaQc3MQ78ith-rNbfNWihvxaWB2Uz-7NGUX3-SYR3Mzj8Ox8xAMl0D3K-ml4k42TJ0OkfuJepDNzaSiNrwM2x0t7AmLN-Vo3-0RdLg6Sg0ughYl5Z5vhlk2miwzc035Oe6F0vKxVtGnUapRWABkSWpledpfzh6Ytdfqcj9ZNfk_jOKme68-NyxMf2io5J3WCb71jwJ4HGm1rHxs_UWpJ2W_nL2Qk_L6oldh6zrTbDRGDt03WVuX2mdtVuJdndfiVuOX1v7btihwetd01d7BkqStwNX0WaZgMKlV7AN60NLAQ2tz3x6_QQtuDPziZ-tUW3Cg_VJBA4hY_JX8zRHl7mcamcVRrBLqedEFyJVuP-0GrHLH-n7BIn77GfiIrBAI8qLOBSmiO4xSHCoh1zSltlVeZ9MI_OZBPghMfBZmYjtxQlFiQqsHioMJEyEQWGvDdqxYRtxghvttsLq-cN4nlafBDN-c6B6weWosivptRimh-Nf14G_Ko7XsKCp0Jy5uHCQpU4a7cS0RJdNFXNYI1qo7tsJPtkm24-RV89Q3FB5uON2iQ7dn0uwWcIPZBvhzFITUGoefgJDctzc7-pDctCp34Y2Ad0eB2Nz7yMza0dv7s6b4LuTlNznYOhPbRCOjhtP70iKpSRJNMbiWc5w160IYDnyIrXljYSgIryI7KHi2FMsd7gG4e1uM84EJ9IOVQjP2HZo42q-7WgvOYbw_DAY75ykD4F-TVpYo3DKDZegW9uvY45RYQig6sJ9YyH8OllgIe5DC4GjILZBVc4F2puSMINlEbfo_aFxdPEhy3o_UXwsw4YEihyQyaZ6HLuR5EcItwda1Gly9Om_gBdUwRj6ttzoMClkcs9YUS7HLNSZBiJgNS84qazIdyDBMMPvDyDuJurV7sQ0IO9RVyi9_l7caYyVwg9wWUIcXrGToA6vARESMlfWEzRNpfqtc-940-heeCcs-gc7zdIsqp74LCYTQTdrNsAI1R_Fu7h3y5faQlIEUmLILfe7EONo2BHsnXChvK3Xk7DEb8ur6iM1kjqA4OTgjdbF-nVUldVLfiFytZdNQskgrUbuXWimGw7xzQna0kA8eCac1sj9BH-tQi5Zj1_rpdgG4ntTNEFnBLXB59Y21TK9mImK0ChXfb2PoyrS3fQkQciPyPdotCwaYiJnrNrwicMlhg35qXjtsyGrA2zVWuJ9hBiFyjZkusAHRf2FtMeQT9eRjy0y1tJWhv91C42dMQaVUUpQp1QQ2sPnm9SghLkFUIBzugHfodMZ8x6pdel1hKc7VI_1UVkIynp255tUjY2B6KCEKkJ8nwPJLgIuzKw","iv":"glPJe1fx13OWVufCXrE04bbGlKSdKRDX","salt":"78EJhDCFdlTF_ZxJ7L0rRg","length":1089},"conflicted":false,"resolved":false,"dateEdited":1607410847644,"dateCreated":1607099168016},"87a334a0dd1521758b26f839":{"noteId":"169786b13fd7aaee76e2725d","id":"87a334a0dd1521758b26f839","type":"delta","data":[{"insert":"Yes I am a topic note. What are you going to be doing eh? It has been so long. I need you to chill. Okay? You are one annoying person. What are you doing eh? hhhh jhhh j jh h h hj h\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847645,"dateCreated":1604648910780},"8e073d4653614426af3a2362":{"id":"8e073d4653614426af3a2362","deleted":true,"dateEdited":1607410847609,"dateCreated":1604159338437},"8f1699d6cfe9e0708ad73746":{"noteId":"32b69f0b788847af4af763b4","id":"8f1699d6cfe9e0708ad73746","type":"delta","data":[{"insert":"Daily tasks to handle:\nObtaining the blog post from the writer and sending it to the appropriate editor."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"Choosing one blog post to publish "},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"Formatting this blog post, adding images, links, and other styling as appropriate."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"Publish."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"Putting up a story for the new blog post on IG"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"Putting an announcement on Discord"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"Posting about it on Twitter, Hacker News etc"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"Done."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"Total time required: 2 hours\nHourly pay: $5 per hour\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847645,"dateCreated":1605958249386},"908e337f8f8da5707e7589c1":{"id":"908e337f8f8da5707e7589c1","deleted":true,"dateCreated":1604808745447,"dateEdited":1607410847627},"988466db9c0028c16d726c59":{"id":"988466db9c0028c16d726c59","deleted":true,"dateCreated":1606946783288,"dateEdited":1607410847623},"9a13209cc167b40b19c93b74":{"noteId":"cd627f16a8f239feb76af361","id":"9a13209cc167b40b19c93b74","type":"delta","data":[{"attributes":{"list":"ordered"},"insert":"\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847646,"dateCreated":1603258748661},"9ca42fca695a95f45b755b09":{"noteId":"134dce90b0cffefcfd476560","id":"9ca42fca695a95f45b755b09","type":"delta","data":[{"insert":"@whitewr_ites\nAnd those were the days when my eyes were hidden beneath the charcoal of anger and never ending hatred gushing the wave of shrillness and vagueness taking my soul away.\n\n@cosmicrealm_\nAnd those were the days of fun and frolic -\nhide and seek in streets,\nhopscotch with best buddies;\nnow laughter hides as I beseech,\ninnocence hops and flees.\n\n@notexactlyawriter\nAnd those were the days, when wrapping bundles of silence over my shoulders, I kept the noise inside me, hidden and unheard by the world.\n\n@thoughtsnshit__\nAnd those were the days when I trusted the stars and their lights to take me home and make things right for we follow the serenity of the sparkles divine and lay away all the woeful plight.\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847646,"dateCreated":1603255571586},"_uk_@thecodrr@_k":"2tGWUVl1JgtGUkFQD9g4PV3GC-oUjdq6XkynakUqeW0","a3c97cffc188d6189f8a36de":{"id":"a3c97cffc188d6189f8a36de","deleted":true,"dateCreated":1607350549698,"dateEdited":1607410847619},"a76badb6ef0e6d2e8a59ce09":{"noteId":"64f2598b3140adf6ce66688f","id":"a76badb6ef0e6d2e8a59ce09","type":"delta","data":[{"insert":"Self-love - 11\nNostalgia - 4\nWriting - 3\nDiscrimination/Equality - 2\nDepression/Loneliness/Misery/Pain - 16 \n"},{"attributes":{"color":"var(--text)"},"insert":"Women empowerment/women abuse/domestic abuse - 5"},{"insert":"\nAcceptance/letting go - 5\nBeauty - 1\nNature's abuse - 2\nTime - 4\nDeath - 2\nHappiness/Peace - 6\nNature - 5\nHope - 7\nComedy/fun - 11\nFriendship - 1\nShame/Regret - 4\nDarkness - 2\nForgiveness - 1\nHumanity - 5\nLove - 13\nPretense/Lying - 2\nWar - 5\nUnique - 6\n\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847647,"dateCreated":1602747191535},"a78e7b122a31ea24b1bace1d":{"noteId":"417003805f96cfd3682ff444","id":"a78e7b122a31ea24b1bace1d","type":"delta","data":[],"conflicted":false,"resolved":false,"dateEdited":1607410847648,"dateCreated":1606417959764},"ade2ec88c6c5e313dcdafece":{"id":"ade2ec88c6c5e313dcdafece","contentId":"61c38224dd2b3fbd7f7e0b91","type":"note","title":"Instagram Daily Prompt #1 - Winners","headline":"@_penitdown._\nAlthough strength is a shield, recurrent indignation cause fatigue.\n\n@ashwinidodani\nBeyond fatigue, lies a garden full of new beginnings...","pinned":false,"locked":false,"color":"red","tags":[],"favorite":false,"dateCreated":1603170822875,"conflicted":false,"dateEdited":1607410847609},"b5f6c304bb2ebeb10c95a7cd":{"id":"b5f6c304bb2ebeb10c95a7cd","deleted":true,"dateEdited":1607410847610,"dateCreated":1604167978452},"baff7c347e6571dbb00aee26":{"id":"baff7c347e6571dbb00aee26","deleted":true,"dateEdited":1607410847610,"dateCreated":1604159342101},"bfcb57c4c522954b5f215a80":{"id":"bfcb57c4c522954b5f215a80","contentId":"875494a35855bce8012055b6","type":"note","title":"Blunt.","headline":"","pinned":false,"locked":true,"tags":[],"favorite":false,"dateCreated":1607099168060,"conflicted":false,"dateEdited":1607410847611},"c0d153ae5c144af34da44d37":{"id":"c0d153ae5c144af34da44d37","deleted":true,"dateCreated":1607344511008,"dateEdited":1607410847621},"c8a91d5bb5ca50df1c0faa5c":{"id":"c8a91d5bb5ca50df1c0faa5c","contentId":"657ba6d335001b0d790392f1","type":"note","title":"Before beginning there is nothing","headline":"I am lying in a cesspool covered in rags I borrowed from a w","pinned":false,"locked":false,"color":"green","tags":[],"favorite":false,"dateCreated":1605811000380,"conflicted":false,"dateEdited":1607410847611},"ca81622cb6b84b2d43847e23":{"id":"ca81622cb6b84b2d43847e23","deleted":true,"dateEdited":1607410847612,"dateCreated":1604167987309},"cd3e144c477d2ca30d5755f2":{"id":"cd3e144c477d2ca30d5755f2","deleted":true,"dateEdited":1607410847612,"dateCreated":1604159392729},"cd627f16a8f239feb76af361":{"id":"cd627f16a8f239feb76af361","contentId":"9a13209cc167b40b19c93b74","type":"note","title":"Backend - Things I need to implement","headline":"\n","pinned":false,"locked":false,"tags":[],"favorite":false,"dateCreated":1603258748677,"conflicted":false,"dateEdited":1607410847612},"colors":["088bc2c47c76afc39d0aaed5","65bf9f76fa511ef015621462","6a5e1d598ba3a1caf58d57cf","6a8df957481c3111e38c940d","6e3acc37b1116ae4f31ee504","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","76e62846a22186530774a0e6","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","798a465fac0fb85c44443bfd","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","a3c97cffc188d6189f8a36de","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","c0d153ae5c144af34da44d37","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","eef1089b69e1f1b8f628f94d","76e62846a22186530774a0e6","798a465fac0fb85c44443bfd","a3c97cffc188d6189f8a36de","c0d153ae5c144af34da44d37","eef1089b69e1f1b8f628f94d"],"content":["9a13209cc167b40b19c93b74","908e337f8f8da5707e7589c1","8551d4a44017d0be7246b383","0bc2b63838a8eca4a142734b","14e7b576bc9022eca6ac3b8f","1f72a3613005e058b6f90a65","61c38224dd2b3fbd7f7e0b91","9ca42fca695a95f45b755b09","a76badb6ef0e6d2e8a59ce09","d2163186f1150336060627ae","f77d022608486508ccbeb8f0","dbf71ce341c840e7bbaaa5b3","0959cca9f57ca18a70bb5d5f","5866d6900e437a6280bfdb9d","ddee3eb0417d8caf071b1618","e793233cf5af7ca88f8e6678","072e629fbb1300eadf2443f8","87a334a0dd1521758b26f839","20f49206c149e51261e5a409","43ae73c5dd74646bf1d69725","657ba6d335001b0d790392f1","875494a35855bce8012055b6","8f1699d6cfe9e0708ad73746","a78e7b122a31ea24b1bace1d","d28b39abf684fb36fd6d89c5","e9c257f2c74a50c34b668684"],"d12133e79297bd7bed674a38":{"id":"d12133e79297bd7bed674a38","deleted":true,"dateEdited":1607410847623,"dateCreated":1604808745470},"d2163186f1150336060627ae":{"noteId":"6c1e7f277554ae204683b105","id":"d2163186f1150336060627ae","type":"delta","data":[{"insert":"The Current Procedure:"},{"attributes":{"header":2},"insert":"\n"},{"insert":"User sends his "},{"attributes":{"bold":true},"insert":"username "},{"insert":"and "},{"attributes":{"bold":true},"insert":"password"},{"insert":" for authentication and verification."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"The server hashes the password and if the hashes match:"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"An "},{"attributes":{"bold":true},"insert":"access_token"},{"insert":" and "},{"attributes":{"bold":true},"insert":"refresh_token"},{"insert":" is generated of 10 hours and 30 days expiry time respectively."},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"Both the tokens are sent back to the user along with his user data."},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"The user receives the response and saves it in Storage"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"The "},{"attributes":{"bold":true},"insert":"access_token"},{"insert":" is sent in the Authorization Header with each following request."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"In case the "},{"attributes":{"bold":true},"insert":"access_token "},{"insert":"expires, a new token is requested with "},{"attributes":{"bold":true},"insert":"refresh_token"},{"insert":" in the POST body."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"Server parses and verifies the "},{"attributes":{"bold":true},"insert":"refresh_token"},{"insert":" and issues a new "},{"attributes":{"bold":true},"insert":"access_token "},{"insert":"accordingly."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"\n"},{"attributes":{"bold":true},"insert":"Problems with current approach:"},{"insert":"\nRevocation of "},{"attributes":{"bold":true},"insert":"access_token"},{"insert":" and "},{"attributes":{"bold":true},"insert":"refresh_token"},{"insert":" is not possible."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"An issued "},{"attributes":{"bold":true},"insert":"refresh_token "},{"insert":"can be used to generate as many "},{"attributes":{"bold":true},"insert":"access_token"},{"insert":"s as we want."},{"attributes":{"list":"ordered"},"insert":"\n"},{"attributes":{"bold":true},"insert":"refresh_token"},{"insert":" serves as an unnecessary step because in case the client is compromised, the "},{"attributes":{"bold":true},"insert":"refresh_token "},{"insert":"is sitting right beside the "},{"attributes":{"bold":true},"insert":"access_token"},{"insert":"."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"The "},{"attributes":{"bold":true},"insert":"access_token"},{"insert":" is reusable so in case it is compromised, the attacker will have partial access to a user's account. The attacker won't be able to read the contents of the notes as they are encrypted with the user's password but they will be able to perform the following operations:"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"They can fetch the user's personal data like email, username, salt, vault key, and subscription info."},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"They can impersonate the user and potentially replace all the user's notes, corrupting the database."},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"They can add new notes encrypted with a different password causing pollution and perhaps even crashes. "},{"attributes":{"bold":true},"insert":"(THIS MUST BE TESTED)"},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"\n"},{"attributes":{"bold":true},"insert":"Possible solutions for the above problems:"},{"insert":"\nRevocation can be implemented manually if we store all the tokens in the DB and validate them on each request. However, this has a performance problem at scale."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"The same approach as point 1 can be applied here to invalidate the refresh_token on first use and discard it."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"After point 2, it is better to use a single-use refresh_token."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"Unfortunately, we can only reduce the chances of this happening by sending the access_token in a Cookie, reducing expiry time."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"\nNew Procedure Proposal:"},{"attributes":{"header":2},"insert":"\n"},{"insert":"The user signs in by sending his username and password to the server."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"the server verifies and authenticates the user."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"on successful authentication, the user is issued a session_id that includes all the claims. The expiry time is around 1 hour."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"The user is also issued a long-term single-use single-device encrypted refresh_token (SUSDERT)."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"The refresh token is saved in a key-value store of the user"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"With every request, the user automatically sends the session_id in a Cookie."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"In case of expiry, the user sends a POST request with the refresh_token and he is issued a new session_id and refresh_token. The old refresh_token is revoked from the user's key-value store."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"The session will be protected from being hijacked in the following ways:"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"Since the session_id is stored in a HttpOnly, Secure Cookie store, there is very less chance of it being stolen by XSS etc since it is not accessible from JS. "},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"It will have a very small timeout so even a small amount of inactivity will result in the session being revoked."},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"The refresh_token will be single-use and single-device so it will not be possible to use it from another IP except the one to which it was issued."},{"attributes":{"indent":1,"list":"ordered"},"insert":"\n"},{"insert":"\n"},{"attributes":{"bold":true},"insert":"Problems solved with this approach:"},{"insert":"\nUser will have full log of all his devices and the ability to revoke any session he wants. With the use of SSE we can easily log sessions out. This comes automatic with using sessions."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"The attack surface area is reduced by using very short termed session ids with SUSDERT."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"The session_id is not extremely reusable if stolen since it is per-device and short term."},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"\n"},{"attributes":{"bold":true},"insert":"Implementation details:"},{"insert":"\n"},{"attributes":{"list":"ordered"},"insert":"\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847648,"dateCreated":1601979248642},"d28b39abf684fb36fd6d89c5":{"noteId":"1e1a998dd339b35f3cd49432","id":"d28b39abf684fb36fd6d89c5","type":"delta","data":[{"insert":"1. Note apps are too complex"},{"attributes":{"header":2},"insert":"\n"},{"insert":"Sometimes all you want to do is take a note. You don't want to go through the hassle of creating 3 different notebooks, pressing 6 buttons just to create a note. \nIn Notesnook, we aim for 2-tap phenomenon. If an action takes more than 2 taps, it's the wrong action. \nWant to create a note? No problem, you don't even have to tap. Just start typing in the note editor.\nWant to create a notebook? 2 taps. \nTopic? 2 taps. \nFavorite? 2 taps. \nLock? Unlock? Move? All 2 taps. \nSimplicity by design. Notesnook aims to never get in your way. It doesn't tell you how you should do something, just aids in your thinking process.\n2. There's no privacy in note apps"},{"attributes":{"header":2},"insert":"\n"},{"insert":"Take Google Keep for example. Google is notorious for using user data to show personalised ads. This may not seem like a big deal but you never know when you might wish your thoughts were, well, your thoughts. Somethings you just don't want anyone else to know or use. \nThis is where Notesnook comes in. To this date, there are very few zero-knowledge, fully encrypted, sync supported note taking apps. Well, that's a mouthful but it's true.\nOur value is that your notes are your notes. What you want to say should be said without fear, without surveillance, and without anyone snooping. \nAll this comes at 0 hassle to you. You can use the app like usual knowing that everything is safe, protected and yours.\nWe do not care about what you write. We only care that you write.\nA bigger advantage of using Notesnook is that everything is encrypted in your device using a key that you create. This way, no matter what happens you notes, your data, will never be exposed to anyone except you.\n3. User lock in"},{"attributes":{"header":2},"insert":"\n"},{"insert":"Many note taking apps make it extremely difficult to migrate your notes from the app. Notesnook is different in this way. We give options to export your notes in up to 4 formats. Anytime, anywhere. It doesn't matter. W"},{"attributes":{"color":"var(--text)"},"insert":"e do not imprison our users, or force them to use our apps."},{"insert":"\n4. Data loss"},{"attributes":{"header":2},"insert":"\n"},{"insert":"There are over 1000 ratings on Google Play where users complain about data loss. Even in note taking apps with version history. \nNotesnook addresses this problem by doing daily, weekly, or monthly backups. Once you turn on the backups, you can rest assured that all your notes will always be safe. \nThe backups are stored on your device, and you can choose to encrypt them if you like.\n5. Complicated organisation"},{"attributes":{"header":2},"insert":"\n"},{"insert":"Ever wondered why it is so much preferred to take notes in an actual notebook than on a digital app? Why do you see all the journalists and students scribbling away at their notepads? \nEase of access. Notebooks are so simple that the only thing you have to do is open them and start writing.\nNotesnook tries to follow this same philosophy. Organization should be so easy that you can remember where you put everything. \nA lot of note taking apps address this problem the wrong way. They add in hierarchies, tables, boxes, and God knows what. The end result is that the user is baffled when he is wants to organize his notes. Where should he put it? Should he color this? Should he tag this? Should this be on first level or second level? Which box should this belong too? So many questions.\nThe learning curve is so steep that most users end up abandoning digital note taking for good. \nNotesnook is different. It won't make you ask so many questions. Organization is simple and one way. Either the note belongs to a notebook or it doesn't. Either you color it or you tag it. It's amazing how easy note Organization gets like this. \nImagine that you are an author and you want to write a new book. In Notesnook, taking book notes is extremely easy. You create a notebook, you add 1 topic for each chapter then you keep notes related to that chapter in that topic. Simple, efficient, organised. What about cross linking? What if you want to reference a note from one topic into another? "},{"attributes":{"bold":true},"insert":"That's also simple, a note can exist in multiple topics. "},{"insert":"\n\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847649,"dateCreated":1606997006006},"d9d2ede76e3cd8990899f146":{"id":"d9d2ede76e3cd8990899f146","type":"notebook","title":"Streetwriters Anthology","description":"","dateCreated":1602746135349,"pinned":false,"topics":[{"type":"topic","id":"134c7c5a3ed0d200ea08bc30","notebookId":"d9d2ede76e3cd8990899f146","title":"General","dateCreated":1602746135359,"dateEdited":1604648918771,"totalNotes":1,"notes":["64f2598b3140adf6ce66688f"]},{"type":"topic","id":"8a1aa27c25afddacb367cea8","notebookId":"d9d2ede76e3cd8990899f146","title":"Google","dateCreated":1604648672055,"dateEdited":1604648918771,"totalNotes":1,"notes":["169786b13fd7aaee76e2725d"]}],"totalNotes":0,"dateEdited":1607410847615},"da4e12448d8e1603348782e1":{"id":"da4e12448d8e1603348782e1","type":"notebook","title":"Notebook 1","dateCreated":1607168112636,"pinned":false,"topics":[{"type":"topic","id":"f54275080ed7c12082e8054d","notebookId":"da4e12448d8e1603348782e1","title":"General","dateCreated":1607168112678,"dateEdited":1607168115417,"totalNotes":1,"notes":["4e6a0dcd9f2238c825f89878"]}],"totalNotes":0,"dateEdited":1607410847615},"dbf71ce341c840e7bbaaa5b3":{"id":"dbf71ce341c840e7bbaaa5b3","deleted":true,"dateCreated":1604808745447,"dateEdited":1607410847629},"ddee3eb0417d8caf071b1618":{"noteId":"b5f6c304bb2ebeb10c95a7cd","id":"ddee3eb0417d8caf071b1618","type":"delta","data":[],"conflicted":false,"resolved":false,"dateEdited":1607410847650,"dateCreated":1604167976482},"de09b0123546245555f2c4f1":{"id":"de09b0123546245555f2c4f1","contentId":"1f72a3613005e058b6f90a65","type":"note","title":"Blog Ideas","headline":"Writing Quotes\nhttps://writingcooperative.com/18-motivational-quotes-to-bring-out-the-writer-in-you-ea3e61c93734\nhttps://blog.reedsy.com/writing-quote...","pinned":false,"locked":false,"tags":[],"favorite":false,"dateCreated":1603531223469,"conflicted":false,"dateEdited":1607410847613},"e793233cf5af7ca88f8e6678":{"noteId":"5c563ed161509ffb24178436","id":"e793233cf5af7ca88f8e6678","type":"delta","data":[{"insert":"Hello world\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847650,"dateCreated":1604559589524},"e9c257f2c74a50c34b668684":{"noteId":"4e6a0dcd9f2238c825f89878","id":"e9c257f2c74a50c34b668684","type":"delta","data":[{"insert":"In the middle of a sound I woke up. A scream hung between my teeth. I looked around eyes wide, mouth open, searching for the source of my torment. Tears hid in the dark space between my eyes. I did not want to cry.\nI stretched my soul across the ethereal realm seeking the existence of my family. I could touch no one. \nAnd that's how it happened.\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847651,"dateCreated":1606417970446},"eb077a9f82c2a6c5fa69111e":{"id":"eb077a9f82c2a6c5fa69111e","contentId":"072e629fbb1300eadf2443f8","type":"note","title":"Hello","headline":"I am googling.\n","pinned":false,"locked":false,"notebooks":[{"id":"d9d2ede76e3cd8990899f146","topic":"134c7c5a3ed0d200ea08bc30"}],"tags":[],"favorite":false,"dateCreated":1604648692532,"conflicted":false,"dateEdited":1607410847613},"eef1089b69e1f1b8f628f94d":{"id":"eef1089b69e1f1b8f628f94d","deleted":true,"dateCreated":1607406539283,"dateEdited":1607410847621},"f053ed3e1981efc0baf1a939":{"id":"f053ed3e1981efc0baf1a939","contentId":"14e7b576bc9022eca6ac3b8f","type":"note","title":"Two factor authentication flow","headline":"Steps:\nUser presses enable 2fa\nUser is presented with 2 options: 1. SMS 2fa and 2. 2fa via App\nIf user chooses option 2:\nUser is presented with 10-20 ...","pinned":false,"locked":false,"tags":[],"favorite":false,"dateCreated":1603464664206,"conflicted":false,"dateEdited":1607410847614},"f39f4e8d9d01063f74e8fb7d":{"id":"f39f4e8d9d01063f74e8fb7d","deleted":true,"dateCreated":1607406664232,"dateEdited":1607410847624},"f77d022608486508ccbeb8f0":{"noteId":"fac860e01d89026efdc6d29b","id":"f77d022608486508ccbeb8f0","type":"delta","data":[{"insert":"Here's a list of all the blog posts we can right on writing prompts.\n\nWriting prompts for kids"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"5 Best Writing Prompts Generators"},{"attributes":{"list":"ordered"},"insert":"\n"},{"insert":"Ndbdjdn Wonderful going"},{"attributes":{"list":"ordered"},"insert":"\n"}],"conflicted":false,"resolved":false,"dateEdited":1607410847651,"dateCreated":1603627983267},"fac860e01d89026efdc6d29b":{"id":"fac860e01d89026efdc6d29b","contentId":"f77d022608486508ccbeb8f0","type":"note","title":"Writing Prompts Blog Series","headline":"Here's a list of all the blog posts we can right on writing prompts.\n\nWriting prompts for kids\n5 Best Writing Prompts Generators\nNdbdjdn Wonderful goi...","pinned":false,"locked":false,"tags":[],"favorite":false,"dateCreated":1603627983282,"conflicted":false,"dateEdited":1607410847614},"hasConflicts":false,"notebooks":["d9d2ede76e3cd8990899f146","da4e12448d8e1603348782e1"],"notes":["0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","0820cee001cb18c206324b53","134dce90b0cffefcfd476560","169786b13fd7aaee76e2725d","169786b13fd7aaee76e2725d","1e1a998dd339b35f3cd49432","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","2e1288e52e41ecef63a36819","32b69f0b788847af4af763b4","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","417003805f96cfd3682ff444","4e6a0dcd9f2238c825f89878","574169433cb3768301b92071","5c563ed161509ffb24178436","64f2598b3140adf6ce66688f","6c1e7f277554ae204683b105","787ee8c0508aac3ba5492751","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","8e073d4653614426af3a2362","ade2ec88c6c5e313dcdafece","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","b5f6c304bb2ebeb10c95a7cd","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","baff7c347e6571dbb00aee26","bfcb57c4c522954b5f215a80","c8a91d5bb5ca50df1c0faa5c","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","ca81622cb6b84b2d43847e23","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd3e144c477d2ca30d5755f2","cd627f16a8f239feb76af361","de09b0123546245555f2c4f1","eb077a9f82c2a6c5fa69111e","f053ed3e1981efc0baf1a939","fac860e01d89026efdc6d29b","0820cee001cb18c206324b53","2e1288e52e41ecef63a36819","417003805f96cfd3682ff444","8e073d4653614426af3a2362","b5f6c304bb2ebeb10c95a7cd","baff7c347e6571dbb00aee26","ca81622cb6b84b2d43847e23","cd3e144c477d2ca30d5755f2"],"settings":{"type":"settings","id":"35350d292855930caede3bb3","pins":[],"dateEdited":0,"dateCreated":1607406047872},"tags":["3ef180968f57780da0633e60","65a0ec62f1f629f914aa3d3b"],"trash":["18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","18265107ac5466dcc98229c4","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","220dcc97dbcd80220932c670","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","459e1d37d42d28b980216f98","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","988466db9c0028c16d726c59","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","d12133e79297bd7bed674a38","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","f39f4e8d9d01063f74e8fb7d","18265107ac5466dcc98229c4","220dcc97dbcd80220932c670","459e1d37d42d28b980216f98","988466db9c0028c16d726c59","d12133e79297bd7bed674a38","f39f4e8d9d01063f74e8fb7d"],"v":4.2,"vaultKey":{"salt":"XL17g8xSbpXJdFz5gYHJog","iv":"fHrbI_j5lMlxTz0VhHEJXdRf9tBTbOWe","length":9,"cipher":"SRrPpsi9cGOEmzHkEUd_e1oExr6fwsWMAA","remote":true}},"hash":"a438edf4e85f1a275957ad069935c600","hash_type":"md5"} \ No newline at end of file diff --git a/packages/core/__tests__/backup.test.js b/packages/core/__tests__/backup.test.js index 24681fd6d..d323e8253 100644 --- a/packages/core/__tests__/backup.test.js +++ b/packages/core/__tests__/backup.test.js @@ -8,6 +8,7 @@ import v0Backup from "./__fixtures__/backup.v0.json"; import v2Backup from "./__fixtures__/backup.v2.json"; import v3Backup from "./__fixtures__/backup.v3.json"; import v4Backup from "./__fixtures__/backup.v4.json"; +import v42Backup from "./__fixtures__/backup.v4.2.json"; beforeEach(() => { StorageInterface.clear(); @@ -72,6 +73,7 @@ describe.each([ ["v2", v2Backup], ["v3", v3Backup], ["v4", v4Backup], + ["v4.2", v42Backup], ])("testing backup version: %s", (version, data) => { test(`import ${version} backup`, () => { return databaseTest().then(async (db) => { @@ -81,21 +83,21 @@ describe.each([ expect( db.notes.all.every((v) => { + const doesNotHaveContent = v.contentId && !v.content; + const doesNotHaveColors = !v.colors && (!v.color || v.color.length); + const hasTopicsInAllNotebooks = + !v.notebooks || + v.notebooks.every((nb) => !!nb.id && !!nb.topics && !nb.topic); return ( - v.contentId && - !v.content && + doesNotHaveContent && !v.notebook && - (!v.notebooks || - (Array.isArray(v.notebooks) && - v.notebooks.every((nb) => !!nb.id))) && - !v.colors + hasTopicsInAllNotebooks && + doesNotHaveColors ); }) ).toBeTruthy(); - expect( - db.notebooks.all.every((v) => v.title != null && v.description != null) - ).toBeTruthy(); + expect(db.notebooks.all.every((v) => v.title != null)).toBeTruthy(); }); }); diff --git a/packages/core/common.js b/packages/core/common.js index 012619100..25ae132fe 100644 --- a/packages/core/common.js +++ b/packages/core/common.js @@ -17,4 +17,4 @@ export const CHECK_IDS = { backupEncrypt: "backup:encrypt", }; -export const CURRENT_DATABASE_VERSION = 4.2; +export const CURRENT_DATABASE_VERSION = 4.3; diff --git a/packages/core/database/backup.js b/packages/core/database/backup.js index 35b3dd516..bac0beeae 100644 --- a/packages/core/database/backup.js +++ b/packages/core/database/backup.js @@ -94,8 +94,10 @@ export default class Backup { switch (version) { case CURRENT_DATABASE_VERSION: - case 3: case 4: + case 4.1: + case 4.2: + case 3: case 2: { return backup; } diff --git a/packages/core/migrations.js b/packages/core/migrations.js index 3a7b6585c..6d3480b1a 100644 --- a/packages/core/migrations.js +++ b/packages/core/migrations.js @@ -13,7 +13,6 @@ export const migrations = { delta: function (item) { item.data = item.data.ops; item.type = "delta"; - item.dateEdited = Date.now(); item.migrated = true; return item; }, @@ -24,7 +23,6 @@ export const migrations = { item.contentId = item.content.delta; delete item.content; } - item.dateEdited = Date.now(); item.migrated = true; return item; }, @@ -57,13 +55,26 @@ export const migrations = { if (item.notebooks && item.notebooks.every((n) => !n.id)) { item.notebooks = undefined; } - item.dateEdited = Date.now(); + return migrations["4.1"].note(item); + }, + }, + 4.1: { + note: function (item) { + return migrations["4.2"].note(item); + }, + }, + 4.2: { + note: function (item) { + if (item.notebooks) { + item.notebooks = item.notebooks.map((nb) => { + return { id: nb.id, topics: nb.topics || [nb.topic] }; + }); + } item.migrated = true; return item; }, }, - 4.1: {}, - 4.2: { + 4.3: { note: false, notebook: false, tag: false,