Commit 68000b4
fix: npm follower occasionally drops incoming updates (#1831)
The npm follower grabs information from multiple sources that can be out
of sync. This subsequently causes some new package updates to not be
identified and sent to ingestion.
<img width="433" height="612" alt="Screenshot 2026-01-07 at 6 03 43 PM"
src="https://github.com/user-attachments/assets/99c4a8d5-cd90-43d0-9d7a-f8cf1e56683f"
/>
Basically, with the new NPM API, our NPM follower ingests information
from multiple sources. Occasionally there is a delay between picking up
a new change from the NPM changes stream and the change actually showing
up in the specific package metadata.
Previously, we would just drop this change altogether as unactionable.
Subsequent updates to the package could trigger another metadata lookup
that would grab the change, but this results in an indeterminate delay.
Now, we identify that the metadata is out of sync by comparing the
sequential part of the `rev` property. If the metadata `rev` is below
the changes `rev`, we know it is lagging behind and exponentially retry
until the metadata is updated or until 30 seconds (where we then proceed
with the out of sync data).
The NPM follower function does some basic math for when to grab the next
batch and when to exit and wait for a subsequent lambda execution.
Because this change increases the batch time by up to 30 seconds, I have
increased the expected worst-case-scenario time by 30 seconds as well.
----
*By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache-2.0 license*
---------
Co-authored-by: Rico Huijbers <[email protected]>1 parent 64e4485 commit 68000b4
File tree
4 files changed
+63
-19
lines changed- src
- __tests__
- __snapshots__
- devapp/__snapshots__
- package-sources/npmjs
4 files changed
+63
-19
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 55 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
| 100 | + | |
92 | 101 | | |
93 | 102 | | |
94 | 103 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
105 | 135 | | |
106 | | - | |
107 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
108 | 141 | | |
109 | 142 | | |
110 | 143 | | |
| |||
245 | 278 | | |
246 | 279 | | |
247 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
248 | 292 | | |
249 | 293 | | |
250 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
0 commit comments