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
Unknown Object (File)
Tue, May 7, 2:38 PM
Unknown Object (File)
Apr 7 2024, 11:48 AM
Unknown Object (File)
Apr 4 2024, 2:39 AM
Unknown Object (File)
Apr 1 2024, 9:31 AM
Unknown Object (File)
Mar 21 2024, 10:14 AM
Unknown Object (File)
Mar 18 2024, 4:03 PM
Unknown Object (File)
Mar 18 2024, 10:07 AM
Unknown Object (File)
Mar 17 2024, 3:53 PM
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
Lint Not Applicable
Unit
Tests Not Applicable

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