Page MenuHomePhabricator

[lib] refactor integrity reducer add new thread hashes to use sqlite ops
ClosedPublic

Authored by will on Mar 11 2024, 12:40 AM.
Tags
None
Referenced Files
F3377094: D11287.diff
Wed, Nov 27, 3:43 AM
Unknown Object (File)
Wed, Nov 6, 8:03 AM
Unknown Object (File)
Oct 22 2024, 10:01 PM
Unknown Object (File)
Oct 22 2024, 9:56 PM
Unknown Object (File)
Oct 22 2024, 9:25 PM
Unknown Object (File)
Oct 21 2024, 12:07 PM
Unknown Object (File)
Oct 21 2024, 11:58 AM
Unknown Object (File)
Oct 21 2024, 11:46 AM
Subscribers

Details

Summary

Refactors the integrity reducer to use sqlite ops for adding new thread hashes

Depends on D11249

Test Plan

flow check

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

will edited the test plan for this revision. (Show Details)
Harbormaster returned this revision to the author for changes because remote builds failed.Mar 11 2024, 12:58 AM
Harbormaster failed remote builds in B27413: Diff 37961!
will requested review of this revision.Mar 11 2024, 7:02 AM

The reduceIntegrityStore function starts with:

if (
  action.type === logInActionTypes.success ||
  action.type === siweAuthActionTypes.success ||
  action.type === keyserverRegisterActionTypes.success ||
  action.type === fullStateSyncActionType ||
  (action.type === setClientDBStoreActionType &&
    !!action.payload.threadStore &&
    state.threadHashingStatus !== 'completed')
) {
  return { threadHashes: {}, threadHashingStatus: 'starting' };
} else if (action.type === keyserverAuthActionTypes.success) {
  return { ...state, threadHashingStatus: 'starting' };
}

These currently just return either the current state or an empty threadHashes object. Do we have to refactor this in anyway with sqlite ops or is it fine as is?

will retitled this revision from [sqlite] [lib] refactor integrity reducer add new thread hashes to use sqlite ops to [lib] refactor integrity reducer add new thread hashes to use sqlite ops.Mar 11 2024, 3:11 PM
kamil added a reviewer: michal.
In D11287#326127, @will wrote:

The reduceIntegrityStore function starts with:

if (
  action.type === logInActionTypes.success ||
  action.type === siweAuthActionTypes.success ||
  action.type === keyserverRegisterActionTypes.success ||
  action.type === fullStateSyncActionType ||
  (action.type === setClientDBStoreActionType &&
    !!action.payload.threadStore &&
    state.threadHashingStatus !== 'completed')
) {
  return { threadHashes: {}, threadHashingStatus: 'starting' };
} else if (action.type === keyserverAuthActionTypes.success) {
  return { ...state, threadHashingStatus: 'starting' };
}

These currently just return either the current state or an empty threadHashes object. Do we have to refactor this in anyway with sqlite ops or is it fine as is?

If it returns empty object we should generate remove_all_integrity_thread_hashes operation - you could do it in a separate diff

If it returns empty object we should generate remove_all_integrity_thread_hashes operation - you could do it in a separate diff

Agree.

This revision is now accepted and ready to land.Mar 13 2024, 4:20 AM