nextcloud / nextcloud/Android-SingleSignOn
Check `NetworkRequest#mDestroyed` before each network request?
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 74
- Forks
- 36
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 17
Description
I recently ran into an issue while trying to make a network request on an NextcloudAPI instance, on which I called close() before.
Of course, it failed, but at an odd place, that I didn't expected (I think context was null at some place).
This made me wondering why we do check for NetworkRequest#mDestroyed when connecting, but not before each request. Wouldn't make it sense to add this check also at the beginning of AidlNetworkRequest#performNetworkRequestV2 and throw a more meaningful IllegalStateException or something alike?
cc @David-Development
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at AidlNetworkRequest#performNetworkRequestV2 and compare it with the existing NetworkRequest#mDestroyed check performed during connect. Verify that calling close() before a request is detected at the start of the operation and results in a meaningful IllegalStateException rather than a later null-context failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100