Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: do not show modal message if change screens and page rule enabled #731
feat: do not show modal message if change screens and page rule enabled #731
Changes from all commits
2db44f9
d5c5e70
48d14e6
4767e88
adc56e2
6d3f539
2919692
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 116 in Sources/MessagingInApp/Gist/Gist.swift
Sources/MessagingInApp/Gist/Gist.swift#L116
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just return the value of messageLoaded from here? is there a case where
they can have different values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
messageLoaded
is true when an in-app message is showing on the screen and when the in-app message is rendering but not yet on the screen.modalViewManager.isShowingMessage
is true only when the message is already rendered and is displayed on screen.This function is meant to tell you if the message is showing, so it's already been rendered and it's on the screen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but looking into this method, it is where we are setting
messageLoaded
as true and also wheremodalViewManager
is being initialized and view is being set, somodalViewManager.isShowingMessage
is also going to be true here.So, both are being done at the same point and rendering is also done, we are just view here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I worked on improvements to the test suite today, including
isShowingMessage
. These improvements go beyond the scope of this PR, so I'll be opening another PR for this improvement.The intention of
isShowingMessage
remains the same - determine if a message is loaded and is shown (animations complete).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be making these methods synchronized,
cancel
loadModalMessage
since we relying on them for route logic. Could be considered out of scope because previously we were also just relying onmessageLoaded
but I think since we are relying on it for multiple actions, the chance of hitting race condition are gonna increase.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do agree, better threading support in the in-app SDK is needed. I also agree this is out-of-scope because I don't think there is a quick win for MessageManager, for example, synchronized when the rest of the module could also be improved.
I think bigger module-wide refactors could be a more productive approach to this problem. I also think that swift concurrency could solve this problem really well.
Do you disagree and think there is a quick win here? Is it a blocker?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could definitely increase the scope, happy for it be a follow up 👍
Check warning on line 103 in Sources/MessagingInApp/Gist/Managers/MessageManager.swift
Sources/MessagingInApp/Gist/Managers/MessageManager.swift#L103
Check warning on line 69 in Sources/MessagingInApp/Gist/Managers/MessageQueueManager.swift
Sources/MessagingInApp/Gist/Managers/MessageQueueManager.swift#L69
Check warning on line 92 in Sources/MessagingInApp/Gist/Managers/MessageQueueManager.swift
Sources/MessagingInApp/Gist/Managers/MessageQueueManager.swift#L92
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a note: if we do end up going with
messageLoaded
, need to remove itCheck warning on line 77 in Sources/MessagingInApp/Gist/Managers/ModalViewManager.swift
Sources/MessagingInApp/Gist/Managers/ModalViewManager.swift#L77