mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) ensure randomness works when sandbox is cloned from a checkpoint
Summary: This calls a new `initialize` method on the sandbox before we start doing calculations with it, to make sure that `random.seed()` has been called. Otherwise, if the sandbox is cloned from a checkpoint, the seed will have been reset. The `initialize` method includes the functionality previously done by `set_doc_url` since it is also initialization/personalization and this way we avoid introducing another round trip to the sandbox. Test Plan: tested with grist-core configured to use gvisor Reviewers: georgegevoian, dsagal Reviewed By: georgegevoian, dsagal Subscribers: alexmojaki Differential Revision: https://phab.getgrist.com/D3549
This commit is contained in:
@@ -2059,9 +2059,7 @@ export class ActiveDoc extends EventEmitter {
|
||||
num_on_demand_tables: onDemandNames.length,
|
||||
});
|
||||
|
||||
if (this._options?.docUrl) {
|
||||
await this._pyCall('set_doc_url', this._options.docUrl);
|
||||
}
|
||||
await this._pyCall('initialize', this._options?.docUrl);
|
||||
|
||||
// Calculations are not associated specifically with the user opening the document.
|
||||
// TODO: be careful with which users can create formulas.
|
||||
|
||||
Reference in New Issue
Block a user