gristlabs_grist-core/app
Paul Fitzpatrick 007c4492dc (core) notify home db of shares when copying/forking/uploading docs
Summary:
The first time a worker opens a document, it will now check if it has any shares the home db needs to be aware of. If so, they will be added. This is important for documents uploaded/copied/forked/replaced, so that their shares work out of the box.

In future, may want some UI to give user control of whether shares are activated after upload/copy/fork/replace.

It seems tricky currently to know if a document is being opened for the first time. As a proxy, I check whether usage information has been calculated and saved to the db, since I can determine that without adding another db query. It is safe to synchronize shares more than necessary.

This leaves two gaps:
 * If a document is created/uploaded/copied/forked/replaced and no attempt is made to access it prior to using a share, then that share won't actually be available. Not a problem currently I think, since how would a user have determined the share key. But in future it would be good to also do a sync after creation/upload/copy/fork/replacement/...
 * On document replacement, usage info is reset but not absolutely immediately. So in principle shares could fail to be created on first load of the replacement. Usage info reset could be tweaked to give a guarantee here, but also fixing the first point would resolve this second point too.

Test Plan: copy test added

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D4165
2024-01-23 08:09:20 -05:00
..
client (core) Hiding "Create form" button 2024-01-19 13:44:56 +01:00
common (core) Add event for thumbsUp/thumbsDown ratings for HelpCenter articles 2024-01-20 20:17:12 -05:00
gen-server (core) Form Publishing 2024-01-12 11:58:12 -08:00
plugin (core) Forms improvements 2024-01-19 10:34:03 +01:00
server (core) notify home db of shares when copying/forking/uploading docs 2024-01-23 08:09:20 -05:00
tsconfig.json (core) move home server into core 2020-07-21 20:39:10 -04:00