problem with sync and saving data from editor

Open
#358 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
kotlin
Domain
mobile

Research direction

Start by tracing AppRepository.replaceDownloadedPage, PageDataManager's cache, and how PageSaver handles pending edits. Work out what should happen to cached pages and unsaved edits when a download replaces a page, then add regression coverage for reopening and editing after sync; done means the downloaded data is shown without mixing it with stale edits.

Written by the indexing model from the issue text.

Description

bug

When sync downloads a page, AppRepository.replaceDownloadedPage replaces its strokes and images in the database, but PageDataManager is not told. A page still in its cache (for example from a notebook just closed to sync it) keeps its old strokes:

  • reopening the notebook shows the old local version until the page is evicted;
  • edits made to it are saved on top of the downloaded page (by stroke and image id), mixing both versions in the database.

This is not new: it behaved the same before #354, when the editor wrote each edit right away instead of through PageSaver. #354 only makes sure edits are saved before a sync reads pages.

Possible fix: after downloading a page, drop it from PageDataManager's cache, and decide what happens to edits of that page that are not saved yet.

Dominant language
Kotlin
Stars
269
Forks
44
Avg merge
1d 17h
Merged PRs (30d)
22

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Ethran/notable

All issues in Ethran/notable

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.