-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Fix various post sign out requests + bugs #1075
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
Changes from all commits
6b5213e
218d0c2
a852fef
2b2bb4a
75fbb0f
ce167cb
82e21d0
9f08e55
e97a947
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,12 @@ function processNetworkRequestQueue() { | |
| ? enhanceParameters(queuedRequest.command, queuedRequest.data) | ||
| : queuedRequest.data; | ||
|
|
||
| // Check to see if the queue has paused again. It's possible that a call to enhanceParameters() | ||
| // has paused the queue and if this is the case we must return. | ||
| if (isQueuePaused) { | ||
| return; | ||
| } | ||
|
Contributor
Author
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. If we don't do this we'll allow a request to be made that can't possibly succeed so it's better that we never make it at all.
Contributor
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. If someone adds another
Contributor
Author
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. Ok, that's a valid concern. The problem with
Contributor
Author
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. Will think about this some more.
Contributor
Author
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. Ok I got a better solution. We will:
|
||
|
|
||
| HttpUtils.xhr(queuedRequest.command, finalParameters, queuedRequest.type) | ||
| .then(queuedRequest.resolve) | ||
| .catch(queuedRequest.reject); | ||
|
|
@@ -114,9 +120,17 @@ function registerParameterEnhancer(callback) { | |
| enhanceParameters = callback; | ||
| } | ||
|
|
||
| /** | ||
| * Clear the queue so all pending requests will be cancelled | ||
| */ | ||
| function clearRequestQueue() { | ||
| networkRequestQueue = []; | ||
| } | ||
|
|
||
| export { | ||
| post, | ||
| pauseRequestQueue, | ||
| unpauseRequestQueue, | ||
| registerParameterEnhancer, | ||
| clearRequestQueue, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -610,7 +610,7 @@ function handleReportChanged(report) { | |
|
|
||
| // A report can be missing a name if a comment is received via pusher event | ||
| // and the report does not yet exist in Onyx (eg. a new DM created with the logged in person) | ||
| if (report.reportName === undefined) { | ||
| if (report.reportID && report.reportName === undefined) { | ||
|
Contributor
Author
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. In some cases, report data will show up first without a
Contributor
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. Should we attempt to fetch data with ReportID but undefined reportName?
Contributor
Author
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. Yeah so, it's completely OK to do that (see the comment above) and in fact we want to because we might be handling a report comment from Pusher and we need to download it. Reports that we've downloaded already should have some kind of report name in storage. This is a little weird but it's just how it works for now. Maybe in the future we will fix this to make it more obvious that a report has not been fetched from the server and won't use the
Contributor
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. How would it be possible for there to be a report without a reportID? Especially since the Onyx key uses the report ID in the name of the key?
Contributor
Author
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. In theory, this could happen anytime we call |
||
| fetchChatReportsByIDs([report.reportID]); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.