adr-manager icon indicating copy to clipboard operation
adr-manager copied to clipboard

Local storage gets out of sync with GitHub

Open docwhat opened this issue 1 year ago • 0 comments

How to reproduce:

  1. Add a repository to two browsers.
  2. In one browser, create a new ADR and "commit and push".
  3. In the other browser, you will not see the new ADR.
  4. Note that you cannot refresh the browser page to update the list of ADRs.

Workaround

  • You can disconnect and reconnecting will force everything to be reloaded.
  • If you add a second branch, you can switch between the branches to force a refresh for just that repository. Any changes will be lost.

Thoughts

For each repository in the addedRepositories list, the git commit SHA1 should be stored next to the branch.

A small background task can periodically check for new content (e.g., on browser focus if last check was 30+ seconds ago).

To make conflict resolution easier, each ADR may want to keep a git commit SHA1 for the editedMd showing what commit the edits are relative to. That way, you could try to re-apply the diff to the new originalMd.

An alternative is to use the git blob SHA1 since that is all you really care about.

docwhat avatar Feb 02 '23 22:02 docwhat