segmentio / segmentio/analytics.js-integrations
[appboy] Pull Request #25: If a message download is in-progress, wait until complete before logging a custom event
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 125
- Forks
- 136
- Avg merge
- 2h 45m
- Merged PRs (30d)
- 1
Description
Migrated from #25 by @hmedney
Basically this keeps track of the callback in a window.appboy scoped var and provides a new function called _messagingReady(callback). Calls to logCustomEvent() can be wrapped as follows:
this._messagingReady(function() {
window.appboy.logCustomEvent(eventName, properties);
})
When the messages have been downloaded, the callback is invoked. In testing simple pages, it seems to solve the race condition and make the integration more predictable.
For example, if a page instruments as follows:
analytics.load("{writeKey}");
analytics.identify("{userId}")
analytics.page();
The above change will ensure all the Braze in-app messages have been downloaded before the page custom event is called on the SDK.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the appboy integration and trace how message downloads and logCustomEvent() are currently sequenced. Review the migrated Pull Request #25 for the proposed callback behavior, then verify the analytics.load(), identify(), and page() sequence. Done means custom events wait until Braze in-app messages finish downloading.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100