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

Configuration Cleanup #1394

Merged
merged 4 commits into from
Aug 26, 2024
Merged

Configuration Cleanup #1394

merged 4 commits into from
Aug 26, 2024

Conversation

jaxdesmarais
Copy link
Contributor

Summary of changes

Checklist

  • [ ] Added a changelog entry

Authors

@jaxdesmarais jaxdesmarais requested a review from a team as a code owner August 20, 2024 20:28
@jaxdesmarais
Copy link
Contributor Author

@KunJeongPark would love your thoughts on these changes to make sure I didn't miss anything! I went through several tests with triggering a memory warning, but would love a second set of eyes if you're able to pull down this branch and run through some tests. :teamwork:

@KunJeongPark
Copy link
Contributor

I think Sammy also had concerns whether @mainactor annotations were necessary in two places.

@jaxdesmarais
Copy link
Contributor Author

I think Sammy also had concerns whether @mainactor annotations were necessary in two places.

I addressed those in the original PR: #1385 (comment)

@braintree braintree deleted a comment from KunJeongPark Aug 23, 2024
@jaxdesmarais
Copy link
Contributor Author

I tested 6.23.3 with @mainactor annotation as it is currently on main wit no changes, 6.23.3 without @mainactor annotation but with await MainActor.run on setHTTPCredentials and completion calls and 6.23.2 with no changes.

Both Task { @MainActor in and MainActor.run around the completion/setupHTTPCredentials do the exact same thing so these will return the same results. I don't think it's worth overcomplicating the callsite as this method will also soon be removed with DTMOBILES-980. Additionally since both behave the same we can keep the callsite simple for now until we move to only using the async config call.

I found that there are no duplicate calls to v1/configuration in any of them, they are all fetching from cache

You'll need to ensure you're letting the cache clear, it's valid for 5 minutes, but first fetch will be false and subsequent will be true. In any case moving to a singular fetch config method will remove this as a grey area if you're unable to replicate due to setup issues.

@KunJeongPark
Copy link
Contributor

KunJeongPark commented Aug 23, 2024

Both Task { @MainActor in and MainActor.run around the completion/setupHTTPCredentials do the exact same thing so these will return the same results. I don't think it's worth overcomplicating the callsite as this method will also soon be removed with DTMOBILES-980. Additionally since both behave the same we can keep the callsite simple for now until we move to only using the async config call.

I'm fine with it, but I don't think they're same and we should keep an eye on latency, although I don't think it will be noticeable.

I found that there are no duplicate calls to v1/configuration in any of them, they are all fetching from cache

You'll need to ensure you're letting the cache clear, it's valid for 5 minutes, but first fetch will be false and subsequent will be true. In any case moving to a singular fetch config method will remove this as a grey area if you're unable to replicate due to setup issues.

I did try it, clearing cache and I got same result. I made note on ticket about low memory setting and NSCache.
I'm good to ✅ this ticket after running one test. Thank you for the clean up!

As I mentioned in the ticket, I just wanted to make sure that there were no inherent problems elsewhere without the @mainactor annotation, if that annotation is masking something, if that makes sense. Not holding this one back.

@KunJeongPark
Copy link
Contributor

KunJeongPark commented Aug 23, 2024

Thank you for the work! Tests look good! 🎉
Did few more tests with low memory, looks good.

Copy link
Contributor

@agedd agedd left a comment

Choose a reason for hiding this comment

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

🚀

@jaxdesmarais jaxdesmarais merged commit 2c26382 into main Aug 26, 2024
8 checks passed
@jaxdesmarais jaxdesmarais deleted the configuration-cleanup branch August 26, 2024 16:38
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.

3 participants