Skip to content

Conversation

@nlutsenko
Copy link
Contributor

This is required #74

  • Added delegate to PFURLSession
  • Updated Tests
  • Added NSNotification posting whenever the request will be sent/finished.

Review on Reviewable

@richardjrossiii
Copy link
Contributor

I'm not super happy about using the default NSNotificationCenter everywhere. Thoughts on having a Parse-specific dependency-injected one? It would make testing/mocking better I think.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we fail below the protocol level (e.g. user switches wifi off), this will be called without a URL Response, and no way to get the error out. Thoughts on having a way to get the underlying network error if one exists here?

There's also no good way to track cancelled requests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this specific case - we don't really care about the result/error/cancellation, only about when the request is about to be sent and when request succeeded.
We don't really need an error right now, or a result, or cancelled status - that's why these are not implemented.

We can expand from here though at any given point of time.

@nlutsenko
Copy link
Contributor Author

Parse-specific - not really
Dependency-injected - sure

Will update in a bit.

@nlutsenko nlutsenko force-pushed the nlutsenko.notifications branch 2 times, most recently from 3433a9b to b1b1abd Compare August 21, 2015 19:26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bad. Self may be re-assigned by init, and then we have a dead delegate value. We should think about how to improve this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, the possibility of that happening is really really close to 0, so better testability (with injected everything) vs rare edge case scenario.

nlutsenko added a commit that referenced this pull request Aug 21, 2015
Added NSNotifications being posted on every network request being sent/finished.
@nlutsenko nlutsenko merged commit a08ca14 into master Aug 21, 2015
@nlutsenko nlutsenko deleted the nlutsenko.notifications branch August 21, 2015 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants