Skip to content

Commit

Permalink
fix: transaction onComplete error to be reported only if error is not…
Browse files Browse the repository at this point in the history
… null (#80)

* fix: log error to console only if error is not null

* updated package version
  • Loading branch information
MrSurana committed Nov 30, 2023
1 parent fc3b4cc commit c5fa9a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hackerrank/firepad",
"description": "Collaborative text editing powered by Firebase",
"version": "0.8.3-beta",
"version": "0.8.4-beta",
"author": {
"email": "bprogyan@gmail.com",
"name": "Progyan Bhattacharya",
Expand Down
4 changes: 2 additions & 2 deletions src/firebase-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,9 @@ export class FirebaseAdapter implements IDatabaseAdapter {
}
},
(error, committed) => {
console.error("[firebase] Transaction error - onComplete", error);

if (error) {
console.error("[firebase] Transaction error - onComplete", error);

if (error.message === "disconnect") {
if (this._sent && this._sent.id === revisionId) {
// We haven't seen our transaction succeed or fail. Send it again.
Expand Down

0 comments on commit c5fa9a1

Please sign in to comment.