Skip to content

Conversation

@roninopf
Copy link
Contributor

@roninopf roninopf commented Mar 2, 2021

🔹 Jira Ticket(s) if any

✏️ Description

  • adds SDK support for persisting read state per user rather than local device only

@codecov
Copy link

codecov bot commented Mar 2, 2021

Codecov Report

Merging #323 (88c5440) into master (423b507) will increase coverage by 0.20%.
The diff coverage is 91.48%.

❗ Current head 88c5440 differs from pull request most recent head 23fe3f8. Consider uploading reports for the commit 23fe3f8 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #323      +/-   ##
==========================================
+ Coverage   70.35%   70.56%   +0.20%     
==========================================
  Files          60       60              
  Lines        3701     3734      +33     
  Branches      430      437       +7     
==========================================
+ Hits         2604     2635      +31     
- Misses        832      833       +1     
- Partials      265      266       +1     
Impacted Files Coverage Δ
...va/com/iterable/iterableapi/IterableConstants.java 0.00% <ø> (ø)
...ableapi/IterableInAppFragmentHTMLNotification.java 48.90% <0.00%> (ø)
...com/iterable/iterableapi/IterableInAppManager.java 87.92% <77.77%> (-0.08%) ⬇️
...le/iterableapi/ui/inbox/IterableInboxFragment.java 83.87% <96.15%> (+1.34%) ⬆️
...le/iterableapi/ui/inbox/IterableInboxActivity.java 81.48% <100.00%> (+5.29%) ⬆️
.../com/iterable/iterableapi/IterableRequestTask.java 84.07% <100.00%> (ø)
...java/com/iterable/iterableapi/ui/BitmapLoader.java 61.90% <0.00%> (-2.39%) ⬇️
...va/com/iterable/iterableapi/IterableApiClient.java 75.15% <0.00%> (+0.31%) ⬆️

Continue to review full report at Codecov.

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

@roninopf roninopf requested a review from vbabenkoru March 9, 2021 01:07
changed = true;
}

if (storage.getMessage(message.getMessageId()) != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

else?

Copy link
Member

Choose a reason for hiding this comment

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

we wont basically need the if condition at this point right? null check is already done and if null, there is a message added in storage above on line 315?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did it like this because it's a discretely separate check (AKA should we overwrite), that happens through the null check.

Copy link
Contributor

Choose a reason for hiding this comment

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

If the reason is for readability, I think the check should be stored in a named variable to express intent. It takes a while to understand what storage.getMessage(message.getMessageId()) == null and storage.getMessage(message.getMessageId()) != null mean.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will add, that's a good idea.

remoteQueueMap.put(message.getMessageId(), message);
if (storage.getMessage(message.getMessageId()) == null) {

if (!isStoringInApp(message)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you don't need a separate method. Just create a local variable like this:
boolean isExistingInApp = storage.getMessage(message.getMessageId()) != null

Copy link
Contributor

Choose a reason for hiding this comment

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

If a boolean is only used within a single method, I think it's easier to define it inline rather than declaring a separate method.

@roninopf roninopf requested a review from vbabenkoru March 11, 2021 22:27
Copy link
Contributor

@vbabenkoru vbabenkoru left a comment

Choose a reason for hiding this comment

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

Approved with one minor comment.

@Ayyanchira Ayyanchira force-pushed the MOB-2606-read-state branch from 18fdc1d to 23fe3f8 Compare March 23, 2021 18:32
@Ayyanchira Ayyanchira merged commit fedfa58 into master Mar 23, 2021
@Ayyanchira Ayyanchira deleted the MOB-2606-read-state branch March 23, 2021 19:07
Ayyanchira added a commit that referenced this pull request Mar 30, 2021
[MOB-2606] persistent read state for inbox in-apps
# Conflicts:
#	iterableapi/src/main/java/com/iterable/iterableapi/IterableInAppManager.java
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