unfoldingWord / tc-create-app

translationCore Create
https://create.translationcore.com/
MIT License
0 stars 5 forks source link

Autosave POC #867

Closed BincyJ closed 3 years ago

BincyJ commented 3 years ago

Use Case: Intermittent internet connection . How do we avoid data loss in this scenario.

Translators can continue editing on tC Create if they lose internet connection and save their work once internet connection is re-established. Auto-saving here means saving data automatically to the offline cache. Data saved on blur.

Not full offline. So when logging out user should be warned that they'll lose their work if they skip clicking on save. As part of POC , Identify the events that may cause work to be lost.

Online - Data saved and loaded from the user branch Offline - Auto-save to index DB.

BincyJ commented 3 years ago

@birchamp to confirm if users would like an indicator on internet connection activity.

ancientTexts-net commented 3 years ago

tc-create-app datatable-translatable markdown-translatable scripture-resources-rcl gitea-react-toolkit

https://github.com/unfoldingWord/tc-create-app/commit/d2a19fac4abd6c3699dacbb65576cdf142fc479d

https://github.com/unfoldingWord/datatable-translatable/commit/3b5745d809bc094de7d1a92fedbfad50c2061e43

https://github.com/unfoldingWord/markdown-translatable/commit/c181b56aa6001e3e11ae1f52853d6767854717e5

https://github.com/unfoldingWord/scripture-resources-rcl/commit/8d5380921e24e170374558ff830476b0f7b3be6f

https://github.com/unfoldingWord/gitea-react-toolkit/commit/9982f0c26b01d063c48a46d236f2e7eb4e5e578a

.

ancientTexts-net commented 3 years ago

IndexedDB storage:

Recent articles:

https://web.dev/storage-for-the-web/#indexeddb

Older articles:

https://stackoverflow.com/questions/5692820/maximum-item-size-in-indexeddb

https://developer.chrome.com/docs/apps/offline_storage/#temporary https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria#storage_limits

ancientTexts-net commented 3 years ago

Regression Cases:

  1. Auto-Save basic path
  2. Multiple Open Files IndexedDB store has multiple rows
  3. Edit "in another browser" App warns about conflict

Autosave Cases

  1. "Internet down" condition when saving
  2. "Close browser" condition
ancientTexts-net commented 3 years ago

.

ancientTexts-net commented 3 years ago

yalc add markdown-translatable yalc add datatable-translatable yalc add gitea-react-toolkit yalc add scripture-resources-rcl

ancientTexts-net commented 3 years ago

43-867 - AutoSave Notes


Stories:

https://app.zenhub.com/workspaces/tc-create-workspace-5f049cdbfa88090016bf043e/issues/unfoldingword/tc-create-app/918

https://app.zenhub.com/workspaces/tc-create-workspace-5f049cdbfa88090016bf043e/issues/unfoldingword/tc-create-app/922

  1. Load autosave data on open
    • Detect autosave conflict on Open
  2. Save autosave
    • onBlur from markdown & datatable
  3. Detect prior autosave content & warn: You have autosaved Paul.md. Do you wish to save this file? (Save / Discard / Cancel)

Phase 2 ?

  1. Compare/Diff Autosave Conflict

(Related = Prompt user to save #883)


Regression Cases ("OLD")

  1. Auto-Save basic path
  2. Multiple Open Files
    IndexedDB store has multiple rows
  3. Edit "in another browser"
    App warns about conflict

Autosave Cases ("NEW")

  1. "Internet down" condition when saving
  2. "Close browser" condition

PRs:

tc-create-app datatable-translatable markdown-translatable scripture-resources-rcl gitea-react-toolkit

https://github.com/unfoldingWord/tc-create-app/commit/d2a19fac4abd6c3699dacbb65576cdf142fc479d

https://github.com/unfoldingWord/datatable-translatable/commit/3b5745d809bc094de7d1a92fedbfad50c2061e43

https://github.com/unfoldingWord/markdown-translatable/commit/c181b56aa6001e3e11ae1f52853d6767854717e5

https://github.com/unfoldingWord/scripture-resources-rcl/commit/8d5380921e24e170374558ff830476b0f7b3be6f

https://github.com/unfoldingWord/gitea-react-toolkit/commit/9982f0c26b01d063c48a46d236f2e7eb4e5e578a


.