Skip to content
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

chore: add handling NoNetworkConnection in image loader [WPB-3475] #2097

Merged
merged 5 commits into from
Aug 16, 2023

Conversation

saleniuk
Copy link
Contributor


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

Image loader needs to be adapter to handle NoNetworkConnection that comes as a response from the network module via GetMessageAssetUseCase.

Solutions

Handle NetworkFailure.NoNetworkConnection in AssetImageFetcher. Introduce a AssetImageRetryPolicy with three values: RETRY_WHEN_CONNECTED, EXPONENTIAL_RETRY_WHEN_CONNECTED, DO_NOT_RETRY, depending on the result returned by the use case. For "no connection" errors, just retry when there is a connection restored, for other server-related errors, also apply exponential delay (maybe there's a temporary problem on a server side so retrying right away doesn't make sense).

Dependencies (Optional)

Needs releases with:

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@codecov
Copy link

codecov bot commented Aug 14, 2023

Codecov Report

Merging #2097 (11f0a90) into develop (aa3bc1d) will increase coverage by 0.04%.
The diff coverage is 65.21%.

@@              Coverage Diff              @@
##             develop    #2097      +/-   ##
=============================================
+ Coverage      40.31%   40.35%   +0.04%     
- Complexity       952      956       +4     
=============================================
  Files            305      305              
  Lines          11290    11307      +17     
  Branches        1512     1516       +4     
=============================================
+ Hits            4551     4563      +12     
- Misses          6302     6307       +5     
  Partials         437      437              
Files Changed Coverage Δ
...com/wire/android/util/ui/WireSessionImageLoader.kt 10.34% <20.00%> (+2.50%) ⬆️
...tlin/com/wire/android/util/ui/AssetImageFetcher.kt 61.40% <100.00%> (+8.21%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa3bc1d...11f0a90. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 14, 2023

Test Results

552 tests  +6   551 ✔️ +6   5m 58s ⏱️ +8s
  80 suites ±0       1 💤 ±0 
  80 files   ±0       0 ±0 

Results for commit 11f0a90. ± Comparison against base commit aa3bc1d.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 1080 succeeded.

The build produced the following APK's:

@saleniuk saleniuk requested review from a team, typfel, MohamadJaara, vitorhugods, mchenani and trOnk12 and removed request for a team August 16, 2023 12:07
@github-actions
Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 1135 succeeded.

The build produced the following APK's:

@saleniuk saleniuk added this pull request to the merge queue Aug 16, 2023
Merged via the queue into develop with commit ef87bf2 Aug 16, 2023
11 checks passed
@saleniuk saleniuk deleted the chore/handle_no_network_in_image_loader branch August 16, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants