Allow using cached tokens for local integ testing #470

Merged
sarah merged 5 commits from cached_tokens into master 2022-11-30 16:51:55 +00:00
Owner

(also new TORCACHE env for integ testing to speed up bootstrapping locally)

(also new TORCACHE env for integ testing to speed up bootstrapping locally)
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/47
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/48
sarah changed title from WIP: Allow using cached tokens for local integ testing to Allow using cached tokens for local integ testing 2022-10-25 20:59:20 +00:00
sarah force-pushed cached_tokens from f5938cab85 to f2b879a9c4 2022-10-25 20:59:52 +00:00 Compare
sarah added 1 commit 2022-10-25 21:05:14 +00:00
continuous-integration/drone/pr Build is failing Details
4324ffae03
safely close db when cps fails
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/50
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/51
sarah added 1 commit 2022-11-23 16:01:48 +00:00
continuous-integration/drone/pr Build is passing Details
0ba45cd59a
Move Cached Token Loading into Server Join (from SMTG)
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/52
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/53
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/54
dan approved these changes 2022-11-29 23:25:19 +00:00
dan left a comment
Owner

just quesitons and a symantic rename thought

just quesitons and a symantic rename thought
@ -75,6 +76,17 @@ type cwtchPeer struct {
eventBus event.Manager
}
func (cp *cwtchPeer) LoadCachedTokens(tokenServer string, tokens []*privacypass.Token) {
Owner

possibly StoreCachedTokens

possibly StoreCachedTokens
@ -772,3 +783,3 @@
// Close closes the underlying database and prepared statements
func (cps *CwtchProfileStorage) Close() {
func (cps *CwtchProfileStorage) Close(purgeAllNonSavedMessages bool) {
Owner

just asking, whats the future use of this planned to be?

just asking, whats the future use of this planned to be?
Author
Owner

it's used now to differentiate between closing a concurrent database (after opening it to check the password - where we don't want to purge all temp messages) v.s. closing it to shutdown cwtch (where we do)

it's used now to differentiate between closing a concurrent database (after opening it to check the password - where we don't want to purge all temp messages) v.s. closing it to shutdown cwtch (where we do)
dan marked this conversation as resolved
@ -17,0 +21,4 @@
}
// StoreNewTokens adds tokens to the internal list managed by this TokenManager
func (tm *TokenManager) StoreNewTokens(tokens []*privacypass.Token) {
Owner

it's called 'store' here

it's called 'store' here
@ -37,3 +49,1 @@
token := tm.tokens[0]
tm.tokens = tm.tokens[1:]
return token, len(tm.tokens), nil
for serializedToken, token := range tm.tokens {
Owner

wnh the change to this for range loop? the above code had a len == 0 check, curious what was tripping up here

wnh the change to this for range loop? the above code had a len == 0 check, curious what was tripping up here
Author
Owner

changed from a list to a map so we can preserve keys (and delete by key), can't access a map by an index (since all elements have a random index in go by convention)

changed from a list to a map so we can preserve keys (and delete by key), can't access a map by an index (since all elements have a random index in go by convention)
dan marked this conversation as resolved
sarah added 1 commit 2022-11-30 15:58:48 +00:00
continuous-integration/drone/pr Build is passing Details
e319976832
Load->StoreCachedTokens
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch/56
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch/57
sarah merged commit 9ef244bc80 into master 2022-11-30 16:51:55 +00:00
Sign in to join this conversation.
No description provided.