Commit d18c7ec
Update prod (#493)
* Fix: Improve quota notification and blocking logic (#489)
* Improve quota notification and blocking logic
Refactored the quota check to ensure workspaces are blocked and notified only when appropriate. Added logging for both blocking and approaching quota limits, and clarified notification task handling.
* Suppress magic number lint warning in logger
Added an ESLint directive to ignore the magic number warning for the percentage calculation in the workspace events limit log message.
* Fix: save workspace blocked date (#491)
* pull new hawk types
* Track blocked date for workspaces in LimiterWorker
Adds a 'blockedDate' property to workspaces when blocking and unblocking them. This allows tracking when a workspace was blocked or cleared, improving auditability and state management.
* Add and populate blockedDate for blocked workspaces
Introduces the blockedDate field to workspace updates in dbHelper and ensures it is set for all blocked workspaces, including a temporary fix for existing records missing this field. This change supports better tracking of when a workspace was blocked and prepares for future removal of the migration code.
* Add tests for blockedDate handling in workspaces
Extended tests to cover setting and clearing the blockedDate field when blocking and unblocking workspaces. Added scenarios for updating blockedDate when missing and verifying correct behavior during workspace state transitions.
* Update index.ts
* Refactor blocked workspace reminder to use days after block
Renamed variables and template placeholders from 'daysAfterPayday' to 'daysAfterBlock' to more accurately reflect the time since a workspace was blocked. Updated related logic, types, and templates to use the new naming and calculation. Added a utility function to compute days after block in payday.ts.
* Update yarn.lock to deduplicate and reorder entries
This commit cleans up the yarn.lock file by removing duplicate entries, consolidating package references, and reordering dependencies for consistency. No package versions were changed; this improves maintainability and reduces lockfile bloat.
* Rename daysAfterPayday to daysAfterBlock in payload
Updated variable and property names from daysAfterPayday to daysAfterBlock in SenderWorker to reflect the correct payload structure and improve clarity.
* Handle undefined daysAfterBlock in reminders logic
Updated countDaysAfterBlock to return undefined instead of null when blockedDate is missing. Adjusted paymaster worker logic to check for undefined, ensuring reminders are sent only when daysAfterBlock is valid.
* Adjust blockedDate calculation in PaymasterWorker test
Updates the blockedDate assignment to subtract days based on expectedDaysAfterBlock in the PaymasterWorker test, improving test accuracy for blocked subscriptions.
* Update workers/paymaster/tests/index.test.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update workers/paymaster/src/index.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update lib/utils/payday.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update dbHelper.test.ts
* Remove obsolete test and update blocked workspace logic
Deleted a test for setting blockedDate on already blocked workspaces in limiter tests, as the scenario is no longer relevant. Updated workspace mock to include blockedDate as undefined. Simplified reminder logic in PaymasterWorker by removing unnecessary undefined check for daysAfterBlock.
* Refactor blockedDate handling in workspace mocks
Removed redundant logic for setting blockedDate when workspace is already blocked in LimiterWorker. Standardized blockedDate type to Date (not Date | null/undefined) in test mocks and updated test cases to use null instead of undefined where appropriate.
* Update index.test.ts
* Update dbHelper.test.ts
* Update index.test.ts
* Update index.test.ts
* Update workers/paymaster/tests/index.test.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update index.test.ts
* Update workers/paymaster/src/index.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update lib/utils/payday.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update workers/paymaster/src/index.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update emailOverview.ts
* Update workers/limiter/src/index.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update lib/utils/payday.ts
Co-authored-by: Peter <specc.dev@gmail.com>
* Update index.test.ts
* Update index.test.ts
* Update index.ts
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Peter <specc.dev@gmail.com>
* feat(js): arrange babel plugins respectfully to vue and svetle frameworks (#492)
* feat(): arrange babel plugins respectfully to vue and svetle frameworks
* chore(): add context to hawk errors and cover utils with tests
* chore(): clean up
* Update workers/javascript/src/utils.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* chore(): fix tests description
* imp(): move getFunctionContext to utils
* chore(): lint fix
* chore(): improve jsdoc
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Taly <vitalik7tv@yandex.ru>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Peter <specc.dev@gmail.com>
Co-authored-by: e11sy <130844513+e11sy@users.noreply.github.com>1 parent 7f8782b commit d18c7ec
File tree
4 files changed
+619
-267
lines changed- workers/javascript
- src
- tests
4 files changed
+619
-267
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | 15 | | |
19 | 16 | | |
20 | 17 | | |
| |||
135 | 132 | | |
136 | 133 | | |
137 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | 256 | | |
354 | 257 | | |
355 | 258 | | |
| |||
451 | 354 | | |
452 | 355 | | |
453 | 356 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | 357 | | |
0 commit comments