Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New WEB version not synced at times #1562

Closed
damamasss opened this issue Aug 31, 2019 · 4 comments · Fixed by #2148
Closed

New WEB version not synced at times #1562

damamasss opened this issue Aug 31, 2019 · 4 comments · Fixed by #2148
Labels
bug Something isn't working [OS] web

Comments

@damamasss
Copy link

damamasss commented Aug 31, 2019

Bug about new Web version of Simplenote.
Use mainly Google Chrome, but bug also in other browsers.

Expected.

That my new added text will be synced

Observed.

In web mode add my text, all was good, but not find this text in Simplenote on my iPhone and iPad. Tested and understood that web not synced. Refresh page - again, text have in web mode, but not synced. I log out and log in again and see that one of some added sentences (about 100 chars) duplicate about 10 times

Reproduced

Start reproduce after update Web in August 2019, when new version is main version, and when version which was earlier now is old version. In OLD version today not have this bug.

-|-|Windows 10 x64|Chrome x64 and other browsers, update August 2019

@damamasss damamasss added the bug Something isn't working label Aug 31, 2019
@damamasss
Copy link
Author

damamasss commented Sep 4, 2019

This is Log from console of Google Chrome x64 76.0.3809.132 (64). This when try to create a new note, add new text to other bote, but nothing happens.
After about 1 hour of a normal job

Pastebin:
https://pastebin.com/pF2mVYfd

Active service worker found, no need to register
serviceworker.js:1 Uncaught (in promise) DOMException
app.442a6d438e0b78c3d968.js:146 Simperium config: Production
9serviceworker.js:1 Uncaught (in promise) DOMException
app.442a6d438e0b78c3d968.js:128 Uncaught (in promise) Error: Delta length (122135) does not equal source text length (114851).
at i.diff_fromDelta (app.442a6d438e0b78c3d968.js:128)
at l.apply_object_diff (app.442a6d438e0b78c3d968.js:128)
at app.442a6d438e0b78c3d968.js:128
at Object.t.apply (app.442a6d438e0b78c3d968.js:128)
at app.442a6d438e0b78c3d968.js:20
at app.442a6d438e0b78c3d968.js:146
at Object.noteUpdatedRemotely (app.442a6d438e0b78c3d968.js:20)
at c. (app.442a6d438e0b78c3d968.js:146)
at c.s.emit (app.442a6d438e0b78c3d968.js:20)
at app.442a6d438e0b78c3d968.js:128
i.diff_fromDelta @ app.442a6d438e0b78c3d968.js:128
l.apply_object_diff @ app.442a6d438e0b78c3d968.js:128
(anonymous) @ app.442a6d438e0b78c3d968.js:128
t.apply @ app.442a6d438e0b78c3d968.js:128
(anonymous) @ app.442a6d438e0b78c3d968.js:20
(anonymous) @ app.442a6d438e0b78c3d968.js:146
(anonymous) @ app.442a6d438e0b78c3d968.js:20
(anonymous) @ app.442a6d438e0b78c3d968.js:146
s.emit @ app.442a6d438e0b78c3d968.js:20
(anonymous) @ app.442a6d438e0b78c3d968.js:128
Promise.then (async)
c.update @ app.442a6d438e0b78c3d968.js:128
onChannelUpdate @ app.442a6d438e0b78c3d968.js:128
s.emit @ app.442a6d438e0b78c3d968.js:20
(anonymous) @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
u @ app.442a6d438e0b78c3d968.js:52
characterData (async)
r @ app.442a6d438e0b78c3d968.js:52
n @ app.442a6d438e0b78c3d968.js:52
(anonymous) @ app.442a6d438e0b78c3d968.js:27
c @ app.442a6d438e0b78c3d968.js:27
p @ app.442a6d438e0b78c3d968.js:27
l @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
a.put.onsuccess @ app.442a6d438e0b78c3d968.js:47
IndexedDB (async)
(anonymous) @ app.442a6d438e0b78c3d968.js:47
(anonymous) @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
u @ app.442a6d438e0b78c3d968.js:52
characterData (async)
r @ app.442a6d438e0b78c3d968.js:52
n @ app.442a6d438e0b78c3d968.js:52
(anonymous) @ app.442a6d438e0b78c3d968.js:27
c @ app.442a6d438e0b78c3d968.js:27
p @ app.442a6d438e0b78c3d968.js:27
l @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
u.onsuccess @ app.442a6d438e0b78c3d968.js:47
IndexedDB (async)
(anonymous) @ app.442a6d438e0b78c3d968.js:47
(anonymous) @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
u @ app.442a6d438e0b78c3d968.js:52
characterData (async)
r @ app.442a6d438e0b78c3d968.js:52
n @ app.442a6d438e0b78c3d968.js:52
(anonymous) @ app.442a6d438e0b78c3d968.js:27
c @ app.442a6d438e0b78c3d968.js:27
s.then @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:47
n @ app.442a6d438e0b78c3d968.js:27
h @ app.442a6d438e0b78c3d968.js:27
s @ app.442a6d438e0b78c3d968.js:27
a.get @ app.442a6d438e0b78c3d968.js:47
c.performChange @ app.442a6d438e0b78c3d968.js:128
(anonymous) @ app.442a6d438e0b78c3d968.js:128
p.run @ app.442a6d438e0b78c3d968.js:128
b. @ app.442a6d438e0b78c3d968.js:52
w @ app.442a6d438e0b78c3d968.js:52
E @ app.442a6d438e0b78c3d968.js:52
serviceworker.js:1 Uncaught (in promise) DOMException
app.442a6d438e0b78c3d968.js:20 Uncaught (in promise) TypeError: Cannot read property 'id' of undefined
at app.442a6d438e0b78c3d968.js:20
at app.442a6d438e0b78c3d968.js:128
(anonymous) @ app.442a6d438e0b78c3d968.js:20
(anonymous) @ app.442a6d438e0b78c3d968.js:128
Promise.then (async)
u @ app.442a6d438e0b78c3d968.js:128
c.update @ app.442a6d438e0b78c3d968.js:128
c.add @ app.442a6d438e0b78c3d968.js:128
(anonymous) @ app.442a6d438e0b78c3d968.js:20
(anonymous) @ app.442a6d438e0b78c3d968.js:146
onNewNote @ app.442a6d438e0b78c3d968.js:146
onClick @ app.442a6d438e0b78c3d968.js:146
(anonymous) @ app.442a6d438e0b78c3d968.js:120
_ @ app.442a6d438e0b78c3d968.js:120
(anonymous) @ app.442a6d438e0b78c3d968.js:120
O @ app.442a6d438e0b78c3d968.js:120
j @ app.442a6d438e0b78c3d968.js:120
C @ app.442a6d438e0b78c3d968.js:120
P @ app.442a6d438e0b78c3d968.js:120
Mn @ app.442a6d438e0b78c3d968.js:120
Fn @ app.442a6d438e0b78c3d968.js:120
t.unstable_runWithPriority @ app.442a6d438e0b78c3d968.js:128
fo @ app.442a6d438e0b78c3d968.js:120
Du @ app.442a6d438e0b78c3d968.js:120
(anonymous) @ app.442a6d438e0b78c3d968.js:120
serviceworker.js:1 Uncaught (in promise) DOMException
app.442a6d438e0b78c3d968.js:20 Uncaught (in promise) TypeError: Cannot read property 'id' of undefined
at app.442a6d438e0b78c3d968.js:20
at app.442a6d438e0b78c3d968.js:128
(anonymous) @ app.442a6d438e0b78c3d968.js:20
(anonymous) @ app.442a6d438e0b78c3d968.js:128
Promise.then (async)
u @ app.442a6d438e0b78c3d968.js:128
c.update @ app.442a6d438e0b78c3d968.js:128
c.add @ app.442a6d438e0b78c3d968.js:128
(anonymous) @ app.442a6d438e0b78c3d968.js:20
(anonymous) @ app.442a6d438e0b78c3d968.js:146
onNewNote @ app.442a6d438e0b78c3d968.js:146
onClick @ app.442a6d438e0b78c3d968.js:146
(anonymous) @ app.442a6d438e0b78c3d968.js:120
_ @ app.442a6d438e0b78c3d968.js:120
(anonymous) @ app.442a6d438e0b78c3d968.js:120
O @ app.442a6d438e0b78c3d968.js:120
j @ app.442a6d438e0b78c3d968.js:120
C @ app.442a6d438e0b78c3d968.js:120
P @ app.442a6d438e0b78c3d968.js:120
Mn @ app.442a6d438e0b78c3d968.js:120
Fn @ app.442a6d438e0b78c3d968.js:120
t.unstable_runWithPriority @ app.442a6d438e0b78c3d968.js:128
fo @ app.442a6d438e0b78c3d968.js:120
Du @ app.442a6d438e0b78c3d968.js:120
(anonymous) @ app.442a6d438e0b78c3d968.js:120
serviceworker.js:1 Uncaught (in promise) DOMException
app.442a6d438e0b78c3d968.js:128 Uncaught (in promise) Error: Delta length (123349) does not equal source text length (114851).
at i.diff_fromDelta (app.442a6d438e0b78c3d968.js:128)
at l.apply_object_diff (app.442a6d438e0b78c3d968.js:128)
at app.442a6d438e0b78c3d968.js:128
at Object.t.apply (app.442a6d438e0b78c3d968.js:128)
at app.442a6d438e0b78c3d968.js:20
at app.442a6d438e0b78c3d968.js:146
at Object.noteUpdatedRemotely (app.442a6d438e0b78c3d968.js:20)
at c. (app.442a6d438e0b78c3d968.js:146)
at c.s.emit (app.442a6d438e0b78c3d968.js:20)
at app.442a6d438e0b78c3d968.js:128
i.diff_fromDelta @ app.442a6d438e0b78c3d968.js:128
l.apply_object_diff @ app.442a6d438e0b78c3d968.js:128
(anonymous) @ app.442a6d438e0b78c3d968.js:128
t.apply @ app.442a6d438e0b78c3d968.js:128
(anonymous) @ app.442a6d438e0b78c3d968.js:20
(anonymous) @ app.442a6d438e0b78c3d968.js:146
(anonymous) @ app.442a6d438e0b78c3d968.js:20
(anonymous) @ app.442a6d438e0b78c3d968.js:146
s.emit @ app.442a6d438e0b78c3d968.js:20
(anonymous) @ app.442a6d438e0b78c3d968.js:128
Promise.then (async)
c.update @ app.442a6d438e0b78c3d968.js:128
onChannelUpdate @ app.442a6d438e0b78c3d968.js:128
s.emit @ app.442a6d438e0b78c3d968.js:20
(anonymous) @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
u @ app.442a6d438e0b78c3d968.js:52
characterData (async)
r @ app.442a6d438e0b78c3d968.js:52
n @ app.442a6d438e0b78c3d968.js:52
(anonymous) @ app.442a6d438e0b78c3d968.js:27
c @ app.442a6d438e0b78c3d968.js:27
p @ app.442a6d438e0b78c3d968.js:27
l @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
a.put.onsuccess @ app.442a6d438e0b78c3d968.js:47
IndexedDB (async)
(anonymous) @ app.442a6d438e0b78c3d968.js:47
(anonymous) @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
u @ app.442a6d438e0b78c3d968.js:52
characterData (async)
r @ app.442a6d438e0b78c3d968.js:52
n @ app.442a6d438e0b78c3d968.js:52
(anonymous) @ app.442a6d438e0b78c3d968.js:27
c @ app.442a6d438e0b78c3d968.js:27
s.then @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:47
n @ app.442a6d438e0b78c3d968.js:27
h @ app.442a6d438e0b78c3d968.js:27
s @ app.442a6d438e0b78c3d968.js:27
a.put @ app.442a6d438e0b78c3d968.js:47
c.updateObjectVersion @ app.442a6d438e0b78c3d968.js:128
c.applyChange @ app.442a6d438e0b78c3d968.js:128
(anonymous) @ app.442a6d438e0b78c3d968.js:128
Promise.then (async)
c.applyChange @ app.442a6d438e0b78c3d968.js:128
(anonymous) @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
u @ app.442a6d438e0b78c3d968.js:52
characterData (async)
r @ app.442a6d438e0b78c3d968.js:52
n @ app.442a6d438e0b78c3d968.js:52
(anonymous) @ app.442a6d438e0b78c3d968.js:27
c @ app.442a6d438e0b78c3d968.js:27
p @ app.442a6d438e0b78c3d968.js:27
l @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
u.onsuccess @ app.442a6d438e0b78c3d968.js:47
IndexedDB (async)
(anonymous) @ app.442a6d438e0b78c3d968.js:47
(anonymous) @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
u @ app.442a6d438e0b78c3d968.js:52
characterData (async)
r @ app.442a6d438e0b78c3d968.js:52
n @ app.442a6d438e0b78c3d968.js:52
(anonymous) @ app.442a6d438e0b78c3d968.js:27
c @ app.442a6d438e0b78c3d968.js:27
p @ app.442a6d438e0b78c3d968.js:27
l @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
IndexedDB (async)
(anonymous) @ app.442a6d438e0b78c3d968.js:47
(anonymous) @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
u @ app.442a6d438e0b78c3d968.js:52
characterData (async)
r @ app.442a6d438e0b78c3d968.js:52
n @ app.442a6d438e0b78c3d968.js:52
(anonymous) @ app.442a6d438e0b78c3d968.js:27
c @ app.442a6d438e0b78c3d968.js:27
p @ app.442a6d438e0b78c3d968.js:27
l @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
a.put.onsuccess @ app.442a6d438e0b78c3d968.js:47
IndexedDB (async)
(anonymous) @ app.442a6d438e0b78c3d968.js:47
(anonymous) @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
u @ app.442a6d438e0b78c3d968.js:52
characterData (async)
r @ app.442a6d438e0b78c3d968.js:52
n @ app.442a6d438e0b78c3d968.js:52
(anonymous) @ app.442a6d438e0b78c3d968.js:27
c @ app.442a6d438e0b78c3d968.js:27
p @ app.442a6d438e0b78c3d968.js:27
l @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
u.onsuccess @ app.442a6d438e0b78c3d968.js:47
IndexedDB (async)
(anonymous) @ app.442a6d438e0b78c3d968.js:47
(anonymous) @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:27
u @ app.442a6d438e0b78c3d968.js:52
characterData (async)
r @ app.442a6d438e0b78c3d968.js:52
n @ app.442a6d438e0b78c3d968.js:52
(anonymous) @ app.442a6d438e0b78c3d968.js:27
c @ app.442a6d438e0b78c3d968.js:27
s.then @ app.442a6d438e0b78c3d968.js:27
(anonymous) @ app.442a6d438e0b78c3d968.js:47
n @ app.442a6d438e0b78c3d968.js:27
h @ app.442a6d438e0b78c3d968.js:27
s @ app.442a6d438e0b78c3d968.js:27
a.get @ app.442a6d438e0b78c3d968.js:47
c.performChange @ app.442a6d438e0b78c3d968.js:128
(anonymous) @ app.442a6d438e0b78c3d968.js:128
p.run @ app.442a6d438e0b78c3d968.js:128
b. @ app.442a6d438e0b78c3d968.js:52
w @ app.442a6d438e0b78c3d968.js:52
E @ app.442a6d438e0b78c3d968.js:52
serviceworker.js:1 Uncaught (in promise) DOMException

@msilbers
Copy link

msilbers commented Sep 4, 2019

"After clicking to delete a note, every time they almost immediately "reappear" in my main list.
And in general, updates and edits made in my notes in the Web App tend to not be saved (the notes go back to a previous version)."

Chrome: Version 76.0.3809.132 (Official Build) (64-bit)
Firefox: Version 68.0.2 (64-bit)

/old works for them
internal reference #2316289-zen

@belcherj belcherj self-assigned this Sep 4, 2019
@msilbers
Copy link

msilbers commented Sep 4, 2019

"When using Simplenote with Chrome on my MacBook the notes aren't syncing. I have tried different networks (home and studio)."

reported by a user (internal reference #2323256-zen)

@vrubzov1957
Copy link

I have same problem. On NEW and on OLD version. Dont sync after some time of using

@belcherj belcherj removed their assignment Jan 7, 2020
dmsnell added a commit that referenced this issue Sep 21, 2020
co-authored by @belcherj and @codebykat with design work by @SylvesterWilmott 

## Description

We've been unable to resolve the worst sync bugs in the application and feature development has been artificially limited by the fact that we have to fight a number of data-flow issues tightly coupling different levels of the application's architecture together.

In this branch, we're ripping apart the entire app state and Simperium data flow to rebuild it in order to remove a number of those couplings and races. This commit changes most of the app and was rolled out in staging to test the changes.

We're also replacing `draft-js` with `Monaco` which is almost as big of a change conceptually as changing the state. Moving to `Monaco` allows us to remove a copy of the note data from the app and allows us to maintain a fully-synchronous update cycle, eliminating a race condition between the Simperium copy of the data, the app copy, and the contents in the text buffer.

## Major code changes

 - The interface between `node-simperium` and this app has been moved into Redux state and out of `indexedDB`. The `indexedDB` interface as asynchronous and led to sync issues under a variety of race conditions with the network data, remote updates, browser tab scheduling, whether the browser was focused or hidden behind other windows, and more. The new synchronous interface guarantees that updates occur when we expect them to occur and therefore will be updated by the time we continue processing changes and updates from the server.
 - `Monaco`'s synchronous plaintext interface allows us to extend the atomic "all updates occur together and instantaneously" paradigm to the text buffer. By sharing the note data in the text editor, in the app, and in `node-simperium`, we will guarantee that we won't accidentally apply new edits to old data.
 - In many cases we have been dispatching multiple actions in order to perform one real action. For example, edit a note and then clear out the search state. Because these presented intermediate states for the app, partial updates, they have been removed. Now we have created new Redux actions for these real actions and app state has been adjusted so that each kind of data has its own reducer and those reducers listen to all the actions which could affect them.  Now we will see a single dispatch that multiple reducers listen to instead of dispatching one action type for each reducer.
 - The Simperium connection has been moved into a new centralized middleware. All Simperium interactions take place in this middleware and are no longer woven into the app. This allows the app to update so that there's only ever one copy of a note's data and it's always up to date with the text editor. This resolves longstanding issues with the note list showing expired data. It also allows us to model the Simperium connection as a reactive system that responds to changes in the app and injects new events from the server in a way that's independent from local operation. This has dramatically simplified many different subsystems.
 - The persistence layer has now been created as a separate subsystem from before, when it was integrated with the Simperium code. It now operates as a kind of background worker that persists the Redux state into `indexedDB` and stores the entire contents atomically. Previously, integrated into the note bucket, the persistence layer would update each note, ghost, and bucket value separately leading to mismatches between a note and the base version it was built from, leading to sync issues.
 - So-called "prop drilling" has been replaced by connecting components in the React tree to state. This was done to simplify the interfaces around the app. It was previously difficult to understand what exactly was executing with the `onAction` props because there wasn't a clear way to walk up the component tree in an editor without resorting to text searching. Any `onEdit` type actions have been replaced with `dispatchProps` that directly dispatch the intended actions.

## Related or fixed issues

### Defects
Resolves #2171 (note display doesn't update height immediately upon change from menu bar)
Resolves #2074 (floating IME on Korean input)
Resolves #2014 (when opened note changes so it's not in the search, it still stays open)
Resolves #1953 (when renaming tag, update in search bar if tag opened)
Resolves #1942 (can't easily select start of note content)
Resolves #1887 (renaming a tag removes it from a note)

#### Cursor position and movement
Resolves #2085 (cursor jumps to new note)
Resolves #2035 (cursor hidden at bottom of note)
Resolves #1595 (restore cursor position when flipping between edit/preview mode)
Resolves #1477 (cursor jumping in Windows)

#### Synchronization
Resolves #1938 (not restoring tags when reverting to an earlier revision)
Resolves #1641 (updates to a tag in one session don't update in other sessions until they reload)
Resolves #1640 (infinite duplication of tag name when editing tag)
Resolves #1562 (content not syncing)
Resolves #1520 (only syncing one note at a time/per session)
Resolves #1291 (quirky unsynced changes info)
Resolves #502 (data loss when editing simultaneous with iOS)
Resolves #459 (show note sync indicator)

#### Force-sync
#1897
#800

#### Ghost-Writing
Resolves #2030
Resolves #1787

### Enhancements
Resolves #2162 (mostly - additional syncing metadata for notes)
Resolves #1836 (remove `app-state`)
Resolves #1816 (confusing revision history ordering)
#1537 (add indicator to show syncing status)
Resolves #2036 (logging-out in one sessions logs out all sessions)
Resolves #1410 (logout is buried in app settings and hard to find)

#### Private Mode
#1924 - functionality in Firefox private mode other than offline persistence

### Performance
Resolves #2172 (slow app)
Resolves #501 (slow loading large notes)

### Deprecations
Resolves #2117 (audit use of draftJS)
Resolves #1762 (decorator performance in draftJS)
Resolves #1026 (use of `token` in `localStorage` in `boot.js`)

### Possibly - check these
#1698 (problems with Korean input and lists at start of note)
#1619 (buggy Japanese IME conversion)
#1572 (RTL languages - checked tasks moving to the right)
#1511 (missing characters on Korean IME conversion)
#1456 (slow, possibly 4K-resolution-related)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working [OS] web
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants