Repository navigation
Commit 5ec619e
authored
refactor(insights): start the member activity recorder at process start, not on import (#10596)
* fix(insights): register the member activity shutdown flush at server boot, not on import
Registering process handlers when record.ts loads ran a side effect in every
importer, which broke tests that stub the global process (app/api/chat/utils
.test.ts: "process.on is not a function", failing test shard 2/2 on staging).
startMemberActivityRecorder() now runs from instrumentation-node like the other
background starters, still before any use is recorded.
* fix(insights): start the member activity recorder in Trigger.dev workers too
Workflow, schedule and webhook runs record uses through preprocessing inside
Trigger.dev, which never runs instrumentation-node.ts, so the init hook starts
the recorder as well (idempotent per process).
* fix(insights): start the recorder from prepareTriggerAttempt instead of trigger.config.ts
trigger.config.ts only takes relative imports, which the source-conventions
ratchet does not let grow; prepareTriggerAttempt is the per-attempt setup the
init hook already awaits.
* docs(insights): say where the member activity recorder starts1 parent 21a981f commit 5ec619e
4 files changed
Lines changed: 14 additions & 7 deletions
File tree
- apps/sim
- lib
- core/config
- organizations/member-activity
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
430 | 433 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
74 | 75 | | |
75 | | - | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
88 | | - | |
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
0 commit comments