Skip to content

Integrations Logic fix + Copy mechanism for payloads #59

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

Merged
merged 11 commits into from
Jan 10, 2022

Conversation

prayansh
Copy link
Contributor

@prayansh prayansh commented Nov 29, 2021

  • Correct how events select which device-mode destinations to run against
  • Move logic for device-mode destinations data to Segment.io destination plugin
  • Add a new API to allow manually enabling destinations (useful for destination plugins with no Segment tie-ins)
  • Add a new API to allow copying payloads with ease

@prayansh prayansh requested review from wenxi-zeng and migs647 and removed request for wenxi-zeng November 29, 2021 20:00
@prayansh prayansh force-pushed the pray/integration-logic-fix branch from f7d7a18 to 3709603 Compare January 7, 2022 22:14
@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2022

Codecov Report

❗ No coverage uploaded for pull request base (main@b65247c). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #59   +/-   ##
=======================================
  Coverage        ?   57.71%           
  Complexity      ?      418           
=======================================
  Files           ?       66           
  Lines           ?     7137           
  Branches        ?      690           
=======================================
  Hits            ?     4119           
  Misses          ?     2506           
  Partials        ?      512           

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 b65247c...143cc50. Read the comment docs.

@prayansh prayansh requested a review from wenxi-zeng January 10, 2022 18:33
Copy link
Contributor

@wenxi-zeng wenxi-zeng left a comment

Choose a reason for hiding this comment

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

LGTM

* in coroutines.
*/
@BlockingApi
fun settings(): Settings? = runBlocking {
Copy link
Contributor

Choose a reason for hiding this comment

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

need to add a settings function to JavaAnalytics for compatibility. also unit tests for them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah good catch. will add those

@@ -79,6 +104,7 @@ suspend fun Analytics.checkSettings() {
log("Dispatching update settings on ${Thread.currentThread().name}")
store.dispatch(System.UpdateSettingsAction(settingsObj), System::class)
update(settingsObj, updateType)
store.dispatch(System.ToggleSettingsDispatch(dispatched = true), System::class)
Copy link
Contributor

Choose a reason for hiding this comment

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

just to confirm: we dispatch twice here because we want to ensure settings being successfully propagated to subscribers and then toggle the state?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup i didnt want to preemptively toggle the dispatch

}
// Differs from swift, bcos kotlin can store `enabled` state. ref: https://git.io/J1bhJ
// finding it in timeline rather than using the ref that is provided to cover our bases
find(plugin::class)?.enabled = true
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️ nice and clean

@prayansh prayansh merged commit 65d5419 into main Jan 10, 2022
@prayansh prayansh deleted the pray/integration-logic-fix branch January 10, 2022 21:39
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