Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix indexeddb logging #626

Merged
merged 2 commits into from
Mar 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/store/indexeddb-local-backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ LocalIndexedDBStoreBackend.prototype = {
this._disconnected = false;

console.log(
`LocalIndexedDBStoreBackend.connect: connecting`,
`LocalIndexedDBStoreBackend.connect: connecting...`,
);
const req = this.indexedDB.open(this._dbName, VERSION);
req.onupgradeneeded = (ev) => {
Expand All @@ -145,7 +145,7 @@ LocalIndexedDBStoreBackend.prototype = {
};

console.log(
`LocalIndexedDBStoreBackend.connect: awaiting connection`,
`LocalIndexedDBStoreBackend.connect: awaiting connection...`,
);
return promiseifyRequest(req).then((ev) => {
console.log(
Expand Down Expand Up @@ -344,16 +344,18 @@ LocalIndexedDBStoreBackend.prototype = {
*/
_loadAccountData: function() {
console.log(
`LocalIndexedDBStoreBackend: loading account data`,
`LocalIndexedDBStoreBackend: loading account data...`,
);
return Promise.try(() => {
console.log(
`LocalIndexedDBStoreBackend: loaded account data`,
);
const txn = this.db.transaction(["accountData"], "readonly");
const store = txn.objectStore("accountData");
return selectQuery(store, undefined, (cursor) => {
return cursor.value;
}).then((result) => {
console.log(
`LocalIndexedDBStoreBackend: loaded account data`,
);
return result;
});
});
},
Expand All @@ -364,17 +366,17 @@ LocalIndexedDBStoreBackend.prototype = {
*/
_loadSyncData: function() {
console.log(
`LocalIndexedDBStoreBackend: loading sync data`,
`LocalIndexedDBStoreBackend: loading sync data...`,
);
return Promise.try(() => {
console.log(
`LocalIndexedDBStoreBackend: loaded sync data`,
);
const txn = this.db.transaction(["sync"], "readonly");
const store = txn.objectStore("sync");
return selectQuery(store, undefined, (cursor) => {
return cursor.value;
}).then((results) => {
console.log(
`LocalIndexedDBStoreBackend: loaded sync data`,
);
if (results.length > 1) {
console.warn("loadSyncData: More than 1 sync row found.");
}
Expand Down