diff --git a/package.json b/package.json index 4835724fe..c6b32ccc5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@hackerrank/firepad", "description": "Collaborative text editing powered by Firebase", - "version": "0.8.4-dev-7", + "version": "0.8.4-dev-8", "author": { "email": "bprogyan@gmail.com", "name": "Progyan Bhattacharya", diff --git a/src/firebase-adapter.ts b/src/firebase-adapter.ts index 14d1864de..396b7d610 100644 --- a/src/firebase-adapter.ts +++ b/src/firebase-adapter.ts @@ -349,13 +349,13 @@ export class FirebaseAdapter implements IDatabaseAdapter { Utils.validateFalse(this._ready, "Should not be called multiple times."); if (!this._initialRevisions) { - this._initialRevisions = true; - this._trigger(FirebaseAdapterEvent.InitialRevision); - console.log( - `[firepad] ${this._questionId} _handleInitialRevisions FirebaseAdapterEvent.InitialRevision`, + `[firepad] ${this._questionId} _handleInitialRevisions trigger() FirebaseAdapterEvent.InitialRevision`, { timestamp: Date.now() } ); + + this._initialRevisions = true; + this._trigger(FirebaseAdapterEvent.InitialRevision); } // Compose the checkpoint and all subsequent revisions into a single operation to apply at once. diff --git a/src/monaco-adapter.ts b/src/monaco-adapter.ts index 17295b495..8a0ee6a8f 100644 --- a/src/monaco-adapter.ts +++ b/src/monaco-adapter.ts @@ -388,6 +388,13 @@ export class MonacoAdapter implements IEditorAdapter { return; } + console.log(`[firepad] setText`, { + range: model.getFullModelRange(), + newText: text, + oldText: model.getValue(), + timestamp: Date.now(), + }); + model.applyEdits([ { range: model.getFullModelRange(),