fix: processing events, stale sigits #227

Merged
b merged 2 commits from hotfix-processing-events-10-12 into staging 2024-10-12 11:18:46 +00:00
Member

Issue made it look like notification broadcast failed. During testing I did notice a slower speed generally when resolving notification uploads and publishing but nothing that would indicate a complete failure to update the sigit states for the user.

Further debugging led me to the changes made in 23a04faad8 that consolidated multiple useEffect and changes in f09d9b2378 in processReceivedEvent function.
These small change resulted in userAppData being updated after we already processed some events and combined from processReceivedEvent function resulted in inconsistent app state (mostly due to having no control over execution order and updates).
We will need additional care when making updates for #194 to make sure the async system is robust to handle these edge cases, to make sure we start subscription only after we get the initial user state returned or process events only after the initial state is set.

One more issue that made debugging harder (multiple accounts switching) was the problem with hasSubscribed flag which on the logout wasn't being cleared correctly and it resulted with stale app date unless we manually refreshed the page.

Issue made it look like notification broadcast failed. During testing I did notice a slower speed generally when resolving notification uploads and publishing but nothing that would indicate a complete failure to update the sigit states for the user. Further debugging led me to the changes made in 23a04faad89ae3138008f4b1b9a112bf944f279b that consolidated multiple `useEffect` and changes in f09d9b23787f1ce9b375e453512d639a4d793938 in `processReceivedEvent ` function. These small change resulted in `userAppData` being updated after we already processed some events and combined from `processReceivedEvent ` function resulted in inconsistent app state (mostly due to having no control over execution order and updates). We will need additional care when making updates for https://git.nostrdev.com/sigit/sigit.io/issues/194 to make sure the async system is robust to handle these edge cases, to make sure we **start subscription only after we get the initial user state returned** or process events only after the initial state is set. One more issue that made debugging harder (multiple accounts switching) was the problem with `hasSubscribed` flag which on the logout wasn't being cleared correctly and it resulted with stale app date unless we manually refreshed the page.
enes added 2 commits 2024-10-12 10:31:58 +00:00
Partially revert to before 23a04faad8
fix: clear hasSubscribed after the logout
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 35s
1d1986f082
enes requested review from b 2024-10-12 10:38:16 +00:00
enes requested review from eugene 2024-10-12 10:38:16 +00:00
b merged commit 3a0f155010 into staging 2024-10-12 11:18:46 +00:00
b deleted branch hotfix-processing-events-10-12 2024-10-12 11:18:47 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
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: sigit/sigit.io#227
No description provided.