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

feat(federation): offline backends handling (epic) #1524

Merged
merged 79 commits into from
Jun 26, 2023

Conversation

yamilmedina
Copy link
Contributor

@yamilmedina yamilmedina commented Mar 2, 2023

TaskAR-3122 [Android] Implement UI for sending messages when a remote backend is offline

REOPENING FOR TRACK -ALREADY APPROVED PR- WILL MERGE LATER. #1501


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

This PR covers the cases of displaying partial delivery errors (offline backends) to the user.
The core of this kalium related was merged by PR wireapp/kalium#1548

Smaller PR's merged here (breadcrumbs)

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

Attachments (Optional)

Screen.Recording.2023-02-26.at.13.46.23.mov

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.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

Unit Test Results

  70 files  ±0    70 suites  ±0   41s ⏱️ +2s
442 tests ±0  441 ✔️ ±0  1 💤 ±0  0 ±0 

Results for commit 71ca7f7. ± Comparison against base commit aded576.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

Build available here. Scroll down to Artifacts!

@yamilmedina yamilmedina requested a review from MohamadJaara June 22, 2023 16:01
@github-actions
Copy link
Contributor

Build (dev-debug) available here. Scroll down to Artifacts!

@github-actions
Copy link
Contributor

Build (beta-debug) available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 1 succeeded.

The build produced the following APK's:

@yamilmedina yamilmedina changed the title feat: federation, offline backends message sending (AR-3122) feat(federation): offline backends handling (epic) Jun 23, 2023
@github-actions
Copy link
Contributor

Build (dev-debug) available here. Scroll down to Artifacts!

@github-actions
Copy link
Contributor

Build (beta-debug) available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 87 succeeded.

The build produced the following APK's:

@github-actions
Copy link
Contributor

Build (dev-debug) available here. Scroll down to Artifacts!

@github-actions
Copy link
Contributor

Build (beta-debug) available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 97 succeeded.

The build produced the following APK's:

@github-actions
Copy link
Contributor

Build (beta-debug) available here. Scroll down to Artifacts!

@github-actions
Copy link
Contributor

Build (dev-debug) available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 100 succeeded.

The build produced the following APK's:

Copy link
Contributor

@Garzas Garzas left a comment

Choose a reason for hiding this comment

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

Awesome job 🚀 Just one small question 😄

id = R.string.label_message_partial_delivery_participants_deliver_later,
partialDeliveryFailureContent.filteredRecipientsFailure
.filter {
!it.asString(resources).contentEquals(resources.getString(R.string.username_unavailable_label))
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need to pass resources when you are in composable function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! :D I'm taking note of this, and I will open a small pr with these improvements to avoid blocking builds on develop

Copy link
Contributor

@saleniuk saleniuk left a comment

Choose a reason for hiding this comment

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

Great! I added two suggestions 😉

return when (deliveryStatus) {
is DeliveryStatus.PartialDelivery -> DeliveryStatusContent.PartialDelivery(
failedRecipients = deliveryStatus.recipientsFailedDelivery
.map { userId -> UIText.DynamicString(userList.findUser(userId = userId)?.name.orEmpty()) }
Copy link
Contributor

Choose a reason for hiding this comment

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

We could use:

userList.findUser(userId = userId)?.name.orUnknownName()

This way we get UIText.StringResource when we put the generic name instead of real one and we could filter out it later more easily, I know it's an extreme case but what if someone chose to name his account "Name not available" - it would be filtered out 😅 Instead, when filtering this way:

filter { it is UIText.StringResource && it.resId == R.string.username_unavailable_label }

it would be more safe 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! :D I'm taking note of this, and I will open a small pr with these improvements to avoid blocking builds on develop

<string name="label_message_receive_failure">Download Error</string>
<string name="label_message_decryption_failure_message">Message could not be decrypted.</string>
<string name="label_message_decryption_failure_informative_message">Try resetting the session to generate new encryption keys.</string>
<string name="label_message_knock">%s pinged</string>
<string name="label_message_partial_delivery_participants_count">%1$d participants didn\'t get your message.</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe this should also be a plural string?
for 1 person it should be "1 participant didn't get your message" 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense actually, the only thing, is that designs for this, we are not showing counter total if it's only one participant 😓

@yamilmedina yamilmedina enabled auto-merge June 26, 2023 13:45
@yamilmedina yamilmedina added this pull request to the merge queue Jun 26, 2023
@github-actions
Copy link
Contributor

Build (dev-debug) available here. Scroll down to Artifacts!

@github-actions
Copy link
Contributor

Build (beta-debug) available here. Scroll down to Artifacts!

Merged via the queue into develop with commit 70f17ec Jun 26, 2023
@yamilmedina yamilmedina deleted the feat/epic-federation-offline-messages branch June 26, 2023 14:07
@AndroidBob
Copy link
Collaborator

Build 101 succeeded.

The build produced the following APK's:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants