mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Broadcast doc usage updates to clients
Summary: Introduces a new message type, docUsage, that's broadcast to all connected clients whenever document usage is updated in ActiveDoc. Test Plan: Browser tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3451
This commit is contained in:
@@ -63,6 +63,14 @@ import {Events as BackboneEvents} from 'backbone';
|
||||
* @property {Boolean} fromSelf - Flag to indicate whether the action originated from this client.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Event for a change to document usage. Sent to all clients that have this document open.
|
||||
* @event docUsage
|
||||
* @property {Number} docFD - The file descriptor of the open document, specific to each client.
|
||||
* @property {FilteredDocUsageSummary} data.docUsage - Document usage summary.
|
||||
* @property {Product} data.product - Product that was used to compute `data.docUsage`
|
||||
*/
|
||||
|
||||
/**
|
||||
* Event for when a document is forcibly shutdown, and requires the client to re-open it.
|
||||
* @event docShutdown
|
||||
@@ -111,7 +119,7 @@ import {Events as BackboneEvents} from 'backbone';
|
||||
*/
|
||||
|
||||
const ValidEvent = StringUnion('docListAction', 'docUserAction', 'docShutdown', 'docError',
|
||||
'clientConnect', 'clientLogout',
|
||||
'docUsage', 'clientConnect', 'clientLogout',
|
||||
'profileFetch', 'userSettings', 'receiveInvites');
|
||||
type ValidEvent = typeof ValidEvent.type;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user