-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run migrations and refresh app state if relevant #7620
Merged
Merged
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
f49b260
Initial testing for refreshing Expenisfy app
cb3d47e
Add UserFixAccount command
a8c31bd
Merge branch 'main' of github.com:Expensify/App into amal-migration-app
905275d
Make UserFixAccount match other User_ functions
fbb3024
Require authToken for User_FixAccount
7aeaaa1
Merge branch 'main' of github.com:Expensify/App into amal-migration-app
c6bf430
Merge branch 'main' of github.com:Expensify/App into amal-migration-app
cffa9c0
Move loading of initialization data to Session
7491c3a
Remove unused imports
d60c3e3
Add JSDoc
e11e68e
Create fixAccountAndReload
286d06c
Check for migrations and reload after initial app loadup
b901321
Use early return
c9c52e7
Remove extra parantheses typo
7035a12
Move up in ordering
3c1d5c8
Rename and clean up comments
1eb5989
Merge branch 'main' of github.com:Expensify/App into amal-migration-app
6b258de
Reintroduce required inputs
34b2d12
Remove redundant functions and move reloading data functionality to a…
5eca072
Merge branch 'main' of github.com:Expensify/App into amal-migration-app
20cd05f
remove unused code
afa2de3
Use log instead of console.debug
6212538
Better comment
c34b37d
remove trailiing space
af85157
Merge branch 'main' of github.com:Expensify/App into amal-migration-app
7426e68
Clearer comments
8217889
Fix spelling
c353f45
Merge branch 'main' of github.com:Expensify/App into amal-migration-app
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -116,6 +116,21 @@ function getAppData(shouldSyncPolicyList = true) { | |||||
]); | ||||||
} | ||||||
|
||||||
/** | ||||||
* Run FixAccount to check if we need to fix anything for the user or run migrations. Reinitialize the data if anything changed | ||||||
* because some migrations might create new chat reports, new policies, etc. that the user now has access to. | ||||||
*/ | ||||||
function fixAccountAndReloadData() { | ||||||
API.User_FixAccount() | ||||||
.then((response) => { | ||||||
if (!response.changed) { | ||||||
return; | ||||||
} | ||||||
Log.info('FixAccount found updates for this user, so data will be reinitalized', true, response); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
getAppData(false); | ||||||
TomatoToaster marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
}); | ||||||
} | ||||||
|
||||||
// When the app reconnects from being offline, fetch all initialization data | ||||||
NetworkConnection.onReconnect(getAppData); | ||||||
|
||||||
|
@@ -125,4 +140,5 @@ export { | |||||
setSidebarLoaded, | ||||||
getLocale, | ||||||
getAppData, | ||||||
fixAccountAndReloadData, | ||||||
}; |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB not sure if this comment is necessary. All methods defined in
API.js
do the same thing for different commands/params.