[PR #703] [MERGED] Initialize StorageMap after importing from legacy (#667) #854

Closed
opened 2026-03-03 00:23:30 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BoostIO/BoostNote-App/pull/703
Author: @guneskaan
Created: 11/30/2020
Status: Merged
Merged: 12/6/2020
Merged by: @Rokt33r

Base: masterHead: initialize-after-import


📝 Commits (1)

  • ce1f042 Initialize StorageMap after importing from legacy

📊 Changes

1 file changed (+5 additions, -2 deletions)

View changed files

📝 src/components/organisms/ImportLegacyNotesForm.tsx (+5 -2)

📄 Description

Fixes #667.

setState() call in React runs asynchronously, making the setStorageMap() call inside createFolder() and createNote() asynchronous. React will batch these updates together, making value of storageMap is unreliable inside createNote(), which depends on the updates from createFolder() when importing legacy notes.

Calling initialize() will restore the storageMap() by repopulating folderMap and noteMap.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BoostIO/BoostNote-App/pull/703 **Author:** [@guneskaan](https://github.com/guneskaan) **Created:** 11/30/2020 **Status:** ✅ Merged **Merged:** 12/6/2020 **Merged by:** [@Rokt33r](https://github.com/Rokt33r) **Base:** `master` ← **Head:** `initialize-after-import` --- ### 📝 Commits (1) - [`ce1f042`](https://github.com/BoostIO/BoostNote-App/commit/ce1f0427a2beead42b829fa7e4db3ed55bfe24ea) Initialize StorageMap after importing from legacy ### 📊 Changes **1 file changed** (+5 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/components/organisms/ImportLegacyNotesForm.tsx` (+5 -2) </details> ### 📄 Description Fixes #667. `setState()` call in React runs asynchronously, making the `setStorageMap()` call inside `createFolder()` and `createNote()` asynchronous. React will batch these updates together, making value of `storageMap` is unreliable inside `createNote()`, which depends on the updates from `createFolder()` when importing legacy notes. Calling `initialize()` will restore the `storageMap()` by repopulating `folderMap` and `noteMap`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 00:23:30 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/BoostNote-App#854
No description provided.