Option to sync a case before viewing it#3237
Open
chrisekelley wants to merge 4 commits intodevelopfrom
Open
Conversation
New syncCaseIfOnline property for app-config.json Configure this feature in settings New pulldoc function in sync-couchdb service to sync a single doc.
chrisekelley
commented
Feb 14, 2022
| const expiryTimestamp = syncSessionUrlParts[6].split(':')[0]; | ||
| const timeLeftInToken = Date.now() - parseInt(expiryTimestamp) | ||
| const expiryWindow = 1000 * 60 * 60 * 2; // 2 hours in milliseconds | ||
| if (timeLeftInToken < expiryWindow) { |
Member
Author
There was a problem hiding this comment.
This will expire every 2 hours. Currently calculating age of token. Check : const timeLeftInToken = 24 - Date.now() - parseInt(tokenCreationTime)
chrisekelley
commented
Feb 14, 2022
| if (timeLeftInToken < expiryWindow) { | ||
| // token has expired | ||
| syncSessionInfo = <SyncSessionInfo>await this.http.get(`${syncDetails.serverUrl}sync-session-v2/start/${syncDetails.groupId}/${syncDetails.deviceId}/${syncDetails.deviceToken}`).toPromise() | ||
| } |
Member
Author
There was a problem hiding this comment.
be sure to persist this: await this.variableService.set('syncSessionInfo', syncSessionInfo)
chrisekelley
commented
Feb 14, 2022
| const appConfig = await this.appConfigService.getAppConfig() | ||
| let batchSize = appConfig.batchSize || 100 | ||
| const device = await this.deviceService.getDevice() | ||
| const formInfos = await this.tangyFormsInfoService.getFormsInfo() |
Member
Author
There was a problem hiding this comment.
don't need formInfos and maybe other stuff...
ProcessMonitorDialogComponent caseUpdated field is updated when case is updated. Moved syncDoc in case.service to sync-couchdb.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New syncCaseIfOnline property for app-config.json
Configure this feature in settings
New pulldoc function in sync-couchdb service to sync a single doc.
[List the issues fixed and any other relevant issues]
Type of Change
[Please delete irrelevant options]