Skip to content

Commit

Permalink
missed rust client changes
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-demox committed Oct 16, 2024
1 parent 8839f93 commit 3ba455b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/rust-client/src/store/web_store/js/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ db.version(1).stores({
[Table.StateSync]: indexes('id'),
[Table.BlockHeaders]: indexes('blockNum', 'hasClientNotes'),
[Table.ChainMmrNodes]: indexes('id'),
[Table.Tags]: indexes('tag', 'source_note_id', 'source_account_id'),
[Table.Tags]: indexes('id++', 'tag', 'source_note_id', 'source_account_id'),
});

function indexes(...items) {
Expand Down
6 changes: 3 additions & 3 deletions crates/rust-client/src/store/web_store/js/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export async function addNoteTag(
source_note_id: source_note_id ? source_note_id : "",
source_account_id: source_account_id ? source_account_id : ""
});
} catch {
} catch (err) {
console.error("Failed to add note tag: ", err);
throw err;
}
Expand Down Expand Up @@ -97,7 +97,7 @@ export async function applyStateSync(
transactionIds,
transactionBlockNums
) {
return db.transaction('rw', stateSync, inputNotes, outputNotes, transactions, blockHeaders, chainMmrNodes, async (tx) => {
return db.transaction('rw', stateSync, inputNotes, outputNotes, transactions, blockHeaders, chainMmrNodes, tags, async (tx) => {
await updateSyncHeight(tx, blockNum);
await updateSpentNotes(tx, nullifierBlockNums, nullifiers);
await updateBlockHeader(tx, blockNum, blockHeader, chainMmrPeaks, hasClientNotes);
Expand Down Expand Up @@ -253,7 +253,7 @@ async function updateCommittedNotes(
});

// Remove note tags
await tags.delete({ source_note_id: noteId });
await tx.tags.where('source_note_id').equals(noteId).delete();
}
} catch (error) {
console.error("Error updating committed notes:", error);
Expand Down

0 comments on commit 3ba455b

Please sign in to comment.