Conversation
| id dataForDelegate = [strongSelf prepareDataForDelegate:data request:request response:response]; | ||
| if (successBlock) { | ||
| successBlock(dataForDelegate, response); | ||
| if (request.successBlock) { |
There was a problem hiding this comment.
This is the main change, use the callback on the individual request, otherwise the callback on one of the requests is used for all the requests
There was a problem hiding this comment.
Was it a recent regression? Or was it always like that?
There was a problem hiding this comment.
I think it came in with #3862 in 13.1. That thread had a similar issue with replaying a request which I thought was fixed but the sample app doesn't exercise having different callbacks for each request so I think we missed this part of it
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #3958 +/- ##
==========================================
- Coverage 63.85% 61.37% -2.49%
==========================================
Files 252 255 +3
Lines 22111 22722 +611
==========================================
- Hits 14120 13945 -175
- Misses 7991 8777 +786
🚀 New features to boost your workflow:
|
Clang Static Analysis Issues
Generated by 🚫 Danger |
| [SFSDKCoreLogger e:[strongSelf class] format:@"Failed to refresh expired session. Error: %@", refreshError]; | ||
|
|
||
| // Call the failure block for the triggering request first | ||
| if (request.failureBlock) { |
There was a problem hiding this comment.
For line 478, I saw an issue where the same request is being removed multiple times along with the callback being executed more than once (if the active queue is at least two requests), I'm thinking it's because flushPendingRequestQueue is synchronized to self but the removeObject call isn't.
The part I don't know the history on is why the failure block for first request was triggered separately, it looks like the same values are passed to the failure block whether it's called here or through flushPendingRequestQueue
|
Fix callbacks for RestAPI
…-crash @W-20494096 - Cherry pick of pull request forcedotcom#3958 from bbirman/rest-callbacks
Manually tested for now, I still want to see if we can add a unit/integration test for it