Add roles to UserDiff when encountering missing data
This commit is contained in:
parent
b6c2d211e5
commit
570f98c51c
@ -66,7 +66,7 @@ async function scanMissingData(processesToScan) {
|
||||
if (!existingData) {
|
||||
toDownload.add(hash);
|
||||
// We also add an entry in diff, in case it doesn't already exist
|
||||
await addDiff(processId, state.state_id, hash, field);
|
||||
await addDiff(processId, state.state_id, hash, state.roles, field);
|
||||
} else {
|
||||
// We remove it if we have it in the set
|
||||
if (toDownload.delete(hash)) {
|
||||
@ -221,7 +221,7 @@ async function getBlob(hash) {
|
||||
return result;
|
||||
}
|
||||
|
||||
async function addDiff(processId, stateId, hash) {
|
||||
async function addDiff(processId, stateId, hash, roles, field) {
|
||||
const db = await openDatabase();
|
||||
const storeName = 'diffs';
|
||||
const tx = db.transaction(storeName, 'readwrite');
|
||||
@ -239,7 +239,8 @@ async function addDiff(processId, stateId, hash) {
|
||||
process_id: processId,
|
||||
state_id: stateId,
|
||||
value_commitment: hash,
|
||||
field: '',
|
||||
roles: roles,
|
||||
field: field,
|
||||
description: null,
|
||||
previous_value: null,
|
||||
new_value: null,
|
||||
|
Loading…
x
Reference in New Issue
Block a user