Skip to content

Allow toggling background sending on the fly#1447

Merged
st0012 merged 2 commits intomasterfrom
allow-toggling-background-on-the-fly
May 20, 2021
Merged

Allow toggling background sending on the fly#1447
st0012 merged 2 commits intomasterfrom
allow-toggling-background-on-the-fly

Conversation

@st0012
Copy link
Copy Markdown
Contributor

@st0012 st0012 commented May 20, 2021

In some cases, being able to disable background sending globally is crucial for both users and the SDK itself.

For example, Rails supports having different modes for running the application (server, console, runner, task...etc). In the runner or task mode, the process is killed right after script is returned, usually before the background worker have the chance to send the events. Here's an example issue: #1324

Although Rails provides callbacks for different modes, they're ran after the SDK initialization. And under the current setup, it's not possible to temporarily bypass background sending globally past the SDK initialization stage. So we can't disable the background workers in those callbacks.

To solve the problem, this commit makes it possible to bypass background worker even after it's been initialized.

In some cases, being able to disable background sending globally is
crucial for both users and the SDK itself.

For example, Rails supports having different modes for running the
application (server, console, runner, task...etc). In the runner or task mode,
the process is killed right after script is returned, usually before the
background worker have the chance to send the events. Here's an example
issue: #1324

Although Rails provides callbacks for different modes, they're ran after
the SDK initialization. And under the current setup, it's not possible
to temporarily bypass background sending globally past the
SDK initialization stage. So we can't disable the background workers
in those callbacks.

To solve the problem, this commit makes it possible to bypass background
worker even after it's been initialized.
@st0012 st0012 added this to the 4.5.0 milestone May 20, 2021
@st0012 st0012 self-assigned this May 20, 2021
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 20, 2021

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.83%. Comparing base (5ce32c1) to head (6086d17).
⚠️ Report is 834 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1447      +/-   ##
==========================================
+ Coverage   98.22%   98.83%   +0.61%     
==========================================
  Files         213      118      -95     
  Lines       10034     6202    -3832     
==========================================
- Hits         9856     6130    -3726     
+ Misses        178       72     -106     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@st0012 st0012 merged commit 87bc697 into master May 20, 2021
@st0012 st0012 deleted the allow-toggling-background-on-the-fly branch May 20, 2021 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants