Skip to content

Conversation

@ygrishajev
Copy link
Contributor

@ygrishajev ygrishajev commented Nov 7, 2025

refs #1779

Summary by CodeRabbit

  • Chores

    • Bumped pg-boss dependency to v11.0.4.
  • Bug Fixes

    • Completed-job archival now applied per-queue and controlled by configuration for consistent cleanup.
    • Queue creation no longer includes an explicit name field in options.
  • Tests

    • Updated tests to match per-queue archival behavior and revised queue options.

@ygrishajev ygrishajev requested a review from a team as a code owner November 7, 2025 12:43
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

Walkthrough

Removed provider-level archiveCompletedAfterSeconds, shifted job retention to queue-level deleteAfterSeconds in subscribe, and bumped pg-boss to v11. Tests adjusted for the changed PgBoss constructor and createQueue options; no other functional code paths altered. (50 words)

Changes

Cohort / File(s) Summary
Dependency
apps/notifications/package.json
Bumped pg-boss from ^10.1.6 to ^11.0.4.
PgBoss provider
apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.ts, apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.spec.ts
Removed archiveCompletedAfterSeconds from the PgBoss constructor options; updated provider test mocks to match new constructor signature.
Broker service
apps/notifications/src/infrastructure/broker/services/broker/broker.service.ts, apps/notifications/src/infrastructure/broker/services/broker/broker.service.spec.ts
subscribe() now calls createQueue(queueName, { deleteAfterSeconds }) with value from broker.EVENT_BROKER_ARCHIVE_COMPLETED_AFTER_SECONDS via Config; tests updated to assert this.
Job queue usage
apps/api/src/core/services/job-queue/job-queue.service.ts, apps/api/src/core/services/job-queue/job-queue.service.spec.ts
Removed explicit name property from pgBoss.createQueue options and adjusted tests to no longer assert name.

Sequence Diagram(s)

sequenceDiagram
    participant BrokerSvc as BrokerService
    participant Config as ConfigService
    participant PgBoss as PgBossProvider

    Note over PgBoss: Provider initialized without\narchiveCompletedAfterSeconds (pg-boss v11)
    BrokerSvc->>Config: get(broker.EVENT_BROKER_ARCHIVE_COMPLETED_AFTER_SECONDS)
    Config-->>BrokerSvc: deleteAfterSeconds
    BrokerSvc->>PgBoss: createQueue(queueName, { deleteAfterSeconds })
    PgBoss-->>BrokerSvc: queue created
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify pg-boss v11 constructor/options behavior and defaults for completed-job archiving.
  • Confirm tests/mocks accurately reflect the new PgBoss API.
  • Inspect other integrations for any implicit reliance on provider-level archive settings.

Possibly related PRs

Suggested reviewers

  • baktun14

Poem

🐰 I hopped through code with nimble paws,
options trimmed without a pause,
pg-boss rose up, queues set to clear,
deleteAfterSeconds now steers the year,
tests crunch carrots — tidy applause 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'feat(notifications): upgrades pg-boss' accurately summarizes the main change: a dependency upgrade of pg-boss from ^10.1.6 to ^11.0.4 in the notifications package, along with necessary configuration adjustments across related files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/notifications

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf25677 and ad213cc.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • apps/api/src/core/services/job-queue/job-queue.service.spec.ts (0 hunks)
  • apps/api/src/core/services/job-queue/job-queue.service.ts (0 hunks)
  • apps/notifications/package.json (1 hunks)
  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.spec.ts (0 hunks)
  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.ts (1 hunks)
  • apps/notifications/src/infrastructure/broker/services/broker/broker.service.spec.ts (1 hunks)
  • apps/notifications/src/infrastructure/broker/services/broker/broker.service.ts (1 hunks)
💤 Files with no reviewable changes (3)
  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.spec.ts
  • apps/api/src/core/services/job-queue/job-queue.service.spec.ts
  • apps/api/src/core/services/job-queue/job-queue.service.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/notifications/src/infrastructure/broker/services/broker/broker.service.ts
  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.spec.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/no-jest-mock.mdc)

Don't use jest.mock() to mock dependencies in test files. Instead, use jest-mock-extended to create mocks and pass mocks as dependencies to the service under test.

**/*.spec.{ts,tsx}: Use setup function instead of beforeEach in test files
setup function must be at the bottom of the root describe block in test files
setup function creates an object under test and returns it
setup function should accept a single parameter with inline type definition
Don't use shared state in setup function
Don't specify return type of setup function

Files:

  • apps/notifications/src/infrastructure/broker/services/broker/broker.service.spec.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Never use type any or cast to type any. Always define the proper TypeScript types.

Files:

  • apps/notifications/src/infrastructure/broker/services/broker/broker.service.spec.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

**/*.{js,ts,tsx}: Never use deprecated methods from libraries.
Don't add unnecessary comments to the code

Files:

  • apps/notifications/src/infrastructure/broker/services/broker/broker.service.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
  • GitHub Check: test-build
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
  • GitHub Check: test-build
  • GitHub Check: test-build
  • GitHub Check: test-build
🔇 Additional comments (2)
apps/notifications/src/infrastructure/broker/services/broker/broker.service.spec.ts (1)

49-51: deleteAfterSeconds option confirmed for pg-boss v11.

The test correctly uses deleteAfterSeconds as a valid option for createQueue in pg-boss v11, which controls how long completed/failed job records are kept before deletion. The implementation properly reflects the migration to queue-level configuration, and the test follows all coding guidelines.

apps/notifications/package.json (1)

76-76: The upgrade to pg-boss v11.0.4 is compatible with the codebase.

Verification confirms all identifiable code-level breaking changes have been addressed:

  • deleteAfterSeconds is already in use (addressing the primary v10→v11 breaking change)
  • No deprecated methods (purge, expire, maintain) are present
  • The schedule: false constructor option remains valid in v11
  • No v10-specific interval options (clockMonitorIntervalMinutes, maintenanceIntervalMinutes) are used

The only remaining consideration is operational: automatic migration from v10 jobs is not supported and requires manual job migration via API/SQL, which should be handled as part of deployment procedures rather than code changes.


Comment @coderabbitai help to get the list of available commands and usage tips.

"dev": true,
"license": "ISC",
"bin": {
"semver": "bin/semver"
Copy link
Contributor

@github-actions github-actions bot Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔄 Carefully review the package-lock.json diff

Resolve the comment if everything is ok

* node_modules/@asamuzakjp/css-color                                                       3.2.0 -> 3.1.4
* node_modules/@babel/compat-data                                                          7.28.5 -> 7.24.7
* node_modules/@babel/core                                                                 7.28.5 -> 7.24.7
* node_modules/@babel/generator                                                            7.28.5 -> 7.26.2
* node_modules/@babel/helper-compilation-targets                                           7.27.2 -> 7.24.7
* node_modules/@babel/helper-module-imports                                                7.27.1 -> 7.25.9
* node_modules/@babel/helper-module-transforms                                             7.28.3 -> 7.26.0
* node_modules/@babel/helper-plugin-utils                                                  7.27.1 -> 7.25.9
* node_modules/@babel/helper-validator-identifier                                          7.28.5 -> 7.27.1
* node_modules/@babel/helper-validator-option                                              7.27.1 -> 7.25.9
* node_modules/@babel/helpers                                                              7.28.4 -> 7.27.6
* node_modules/@babel/parser                                                               7.28.5 -> 7.27.2
* node_modules/@babel/plugin-syntax-jsx                                                    7.27.1 -> 7.25.9
* node_modules/@babel/plugin-syntax-typescript                                             7.27.1 -> 7.25.9
* node_modules/@babel/traverse                                                             7.28.5 -> 7.25.9
* node_modules/@babel/types                                                                7.28.5 -> 7.27.6
* node_modules/@jridgewell/gen-mapping                                                     0.3.13 -> 0.3.5
* node_modules/@jridgewell/trace-mapping                                                   0.3.31 -> 0.3.25
* node_modules/@pkgr/core                                                                  0.2.9 -> 0.2.0
* node_modules/@types/yargs                                                                17.0.34 -> 17.0.32
* node_modules/@ungap/structured-clone                                                     1.3.0 -> 1.2.0
* node_modules/babel-preset-current-node-syntax                                            1.2.0 -> 1.0.1
* node_modules/cron-parser                                                                 4.9.0 -> 5.4.0
* node_modules/dedent                                                                      1.7.0 -> 1.5.3
* node_modules/import-local                                                                3.2.0 -> 3.1.0
* node_modules/luxon                                                                       3.5.0 -> 3.7.2
* node_modules/pg-boss                                                                     10.3.2 -> 11.1.2
* node_modules/pirates                                                                     4.0.7 -> 4.0.6
+ node_modules/@ampproject/remapping                                                       2.3.0   
+ node_modules/@jridgewell/set-array                                                       1.2.1   
- apps/api/node_modules/pg-boss                                                            11.0.4  
- apps/deploy-web/node_modules/@jest/console                                               30.2.0  
- apps/deploy-web/node_modules/@jest/core                                                  30.2.0  
- apps/deploy-web/node_modules/@jest/expect-utils                                          30.2.0  
- apps/deploy-web/node_modules/@jest/expect                                                30.2.0  
- apps/deploy-web/node_modules/@jest/globals                                               30.2.0  
- apps/deploy-web/node_modules/@jest/reporters                                             30.2.0  
- apps/deploy-web/node_modules/@jest/source-map                                            30.0.1  
- apps/deploy-web/node_modules/@jest/test-result                                           30.2.0  
- apps/deploy-web/node_modules/@jest/test-sequencer                                        30.2.0  
- apps/deploy-web/node_modules/@jest/transform                                             30.2.0  
- apps/deploy-web/node_modules/agent-base                                                  7.1.4   
- apps/deploy-web/node_modules/babel-jest                                                  30.2.0  
- apps/deploy-web/node_modules/babel-plugin-istanbul                                       7.0.1   
- apps/deploy-web/node_modules/babel-plugin-jest-hoist                                     30.2.0  
- apps/deploy-web/node_modules/babel-preset-jest                                           30.2.0  
- apps/deploy-web/node_modules/camelcase                                                   6.3.0   
- apps/deploy-web/node_modules/cjs-module-lexer                                            2.1.1   
- apps/deploy-web/node_modules/convert-source-map                                          2.0.0   
- apps/deploy-web/node_modules/cssstyle                                                    4.6.0   
- apps/deploy-web/node_modules/data-urls                                                   5.0.0   
- apps/deploy-web/node_modules/expect                                                      30.2.0  
- apps/deploy-web/node_modules/html-encoding-sniffer                                       4.0.0   
- apps/deploy-web/node_modules/iconv-lite                                                  0.6.3   
- apps/deploy-web/node_modules/istanbul-lib-source-maps                                    5.0.6   
- apps/deploy-web/node_modules/jackspeak                                                   3.4.3   
- apps/deploy-web/node_modules/jest-changed-files                                          30.2.0  
- apps/deploy-web/node_modules/jest-circus                                                 30.2.0  
- apps/deploy-web/node_modules/jest-cli/node_modules/jest-config                           30.2.0  
- apps/deploy-web/node_modules/jest-cli                                                    30.2.0  
- apps/deploy-web/node_modules/jest-diff                                                   30.2.0  
- apps/deploy-web/node_modules/jest-docblock                                               30.2.0  
- apps/deploy-web/node_modules/jest-each                                                   30.2.0  
- apps/deploy-web/node_modules/jest-environment-jsdom                                      30.2.0  
- apps/deploy-web/node_modules/jest-environment-node                                       30.2.0  
- apps/deploy-web/node_modules/jest-haste-map                                              30.2.0  
- apps/deploy-web/node_modules/jest-leak-detector                                          30.2.0  
- apps/deploy-web/node_modules/jest-matcher-utils                                          30.2.0  
- apps/deploy-web/node_modules/jest-resolve-dependencies                                   30.2.0  
- apps/deploy-web/node_modules/jest-resolve                                                30.2.0  
- apps/deploy-web/node_modules/jest-runner                                                 30.2.0  
- apps/deploy-web/node_modules/jest-runtime/node_modules/glob                              10.4.5  
- apps/deploy-web/node_modules/jest-runtime/node_modules/minipass                          7.1.2   
- apps/deploy-web/node_modules/jest-runtime                                                30.2.0  
- apps/deploy-web/node_modules/jest-snapshot                                               30.2.0  
- apps/deploy-web/node_modules/jest-validate                                               30.2.0  
- apps/deploy-web/node_modules/jest-watcher/node_modules/chalk                             4.1.2   
- apps/deploy-web/node_modules/jest-watcher                                                30.2.0  
- apps/deploy-web/node_modules/jest-worker/node_modules/supports-color                     8.1.1   
- apps/deploy-web/node_modules/jest-worker                                                 30.2.0  
- apps/deploy-web/node_modules/jest                                                        30.2.0  
- apps/deploy-web/node_modules/jsdom/node_modules/https-proxy-agent                        7.0.6   
- apps/deploy-web/node_modules/jsdom/node_modules/ws                                       8.18.3  
- apps/deploy-web/node_modules/jsdom                                                       26.1.0  
- apps/deploy-web/node_modules/pure-rand                                                   7.0.1   
- apps/deploy-web/node_modules/semver                                                      7.7.3   
- apps/deploy-web/node_modules/signal-exit                                                 4.1.0   
- apps/deploy-web/node_modules/tough-cookie                                                5.1.2   
- apps/deploy-web/node_modules/tr46                                                        5.1.1   
- apps/deploy-web/node_modules/w3c-xmlserializer                                           5.0.0   
- apps/deploy-web/node_modules/webidl-conversions                                          7.0.0   
- apps/deploy-web/node_modules/whatwg-encoding                                             3.1.1   
- apps/deploy-web/node_modules/whatwg-mimetype                                             4.0.0   
- apps/deploy-web/node_modules/whatwg-url                                                  14.2.0  
- apps/deploy-web/node_modules/write-file-atomic                                           5.0.1   
- apps/deploy-web/node_modules/xml-name-validator                                          5.0.0   
- node_modules/@babel/helper-globals                                                       7.28.0  
- node_modules/@jest/diff-sequences                                                        30.0.1  
- node_modules/@jest/environment-jsdom-abstract/node_modules/@jest/environment             30.2.0  
- node_modules/@jest/environment-jsdom-abstract/node_modules/@jest/fake-timers             30.2.0  
- node_modules/@jest/environment-jsdom-abstract/node_modules/@sinonjs/fake-timers          13.0.5  
- node_modules/@jest/environment-jsdom-abstract/node_modules/@types/jsdom                  21.1.7  
- node_modules/@jest/environment-jsdom-abstract/node_modules/ansi-styles                   5.2.0   
- node_modules/@jest/environment-jsdom-abstract/node_modules/ci-info                       4.3.1   
- node_modules/@jest/environment-jsdom-abstract/node_modules/jest-message-util             30.2.0  
- node_modules/@jest/environment-jsdom-abstract/node_modules/jest-mock                     30.2.0  
- node_modules/@jest/environment-jsdom-abstract/node_modules/jest-util                     30.2.0  
- node_modules/@jest/environment-jsdom-abstract/node_modules/picomatch                     4.0.3   
- node_modules/@jest/environment-jsdom-abstract/node_modules/pretty-format                 30.2.0  
- node_modules/@jest/environment-jsdom-abstract                                            30.2.0  
- node_modules/@jest/get-type                                                              30.1.0  
- node_modules/@jest/pattern/node_modules/jest-regex-util                                  30.0.1  
- node_modules/@jest/pattern                                                               30.0.1  
- node_modules/@jest/snapshot-utils/node_modules/@jest/schemas                             30.0.5  
- node_modules/@jest/snapshot-utils/node_modules/@jest/types                               30.2.0  
- node_modules/@jest/snapshot-utils/node_modules/@sinclair/typebox                         0.34.41 
- node_modules/@jest/snapshot-utils                                                        30.2.0  
- node_modules/@jridgewell/remapping                                                       2.3.5   
- node_modules/exit-x                                                                      0.2.2   
- node_modules/synckit                                                                     0.11.11 

@codecov
Copy link

codecov bot commented Nov 7, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
1525 1 1524 0
View the top 1 failed test(s) by shortest run time
HTTP Tools functional validation should return 500 on invalid response schema
Stack Traces | 0.009s run time
Error: expect(received).toBe(expected) // Object.is equality

Expected: 500
Received: 400
    at Object.<anonymous> (.../test/functional/http-tools.spec.ts:56:26)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@ygrishajev ygrishajev force-pushed the feature/notifications branch from c1f4325 to 38d4982 Compare November 7, 2025 13:24
baktun14
baktun14 previously approved these changes Nov 7, 2025
@ygrishajev ygrishajev force-pushed the feature/notifications branch from a0c75ab to e15369b Compare November 10, 2025 10:48
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.ts (1)

17-23: Fix TypeScript type safety violations in executeSql function.

The queue-level deleteAfterSeconds configuration is properly set in broker.service.ts (line 40) using the same config key. However, the executeSql function at lines 19-20 uses any types, violating the coding guidelines. Replace any[] and any with proper types:

executeSql(text: string, values: unknown[]): Promise<{ rows: unknown[] }> {
  return client.query(text, values);
}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a0b1e05 and e15369b.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • apps/notifications/package.json (1 hunks)
  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.spec.ts (0 hunks)
  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.ts (1 hunks)
  • apps/notifications/src/infrastructure/broker/services/broker/broker.service.spec.ts (1 hunks)
  • apps/notifications/src/infrastructure/broker/services/broker/broker.service.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.spec.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/notifications/src/infrastructure/broker/services/broker/broker.service.ts
  • apps/notifications/src/infrastructure/broker/services/broker/broker.service.spec.ts
  • apps/notifications/package.json
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Never use type any or cast to type any. Always define the proper TypeScript types.

Files:

  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

**/*.{js,ts,tsx}: Never use deprecated methods from libraries.
Don't add unnecessary comments to the code

Files:

  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: log-collector-ci
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
  • GitHub Check: validate (apps/provider-console) / validate-unsafe
  • GitHub Check: test-build
  • GitHub Check: test-build
  • GitHub Check: test-build
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build

@ygrishajev ygrishajev force-pushed the feature/notifications branch 2 times, most recently from 40c6a83 to bf25677 Compare November 10, 2025 14:54
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.ts (1)

19-20: Replace any types with proper TypeScript types.

The executeSql function still uses any for both the values parameter and the rows return type, which violates the coding guidelines that explicitly state: "Never use type any or cast to type any."

As per coding guidelines.

Apply this diff to use proper TypeScript types:

       db: {
-        executeSql(text: string, values: any[]): Promise<{ rows: any[] }> {
+        executeSql<T = Record<string, unknown>>(text: string, values?: unknown[]): Promise<{ rows: T[] }> {
           return client.query(text, values);
         }
       }

Alternatively, import QueryResult from pg for more precise typing:

import { Client, QueryResult } from "pg";

Then use:

       db: {
-        executeSql(text: string, values: any[]): Promise<{ rows: any[] }> {
+        executeSql<T = Record<string, unknown>>(text: string, values?: unknown[]): Promise<QueryResult<T>> {
           return client.query(text, values);
         }
       }
🧹 Nitpick comments (1)
apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.ts (1)

12-15: Consider investigating the custom db migration issue.

The TODO comment indicates an unresolved issue where the custom db wrapper cannot be used for migrations. With the pg-boss v11 upgrade, this might be a good opportunity to revisit this limitation and determine if it's still necessary or if the new version handles this differently.

Would you like me to help investigate why the custom db wrapper fails for migrations, or should I open an issue to track this investigation?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e15369b and 40c6a83.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • apps/api/src/core/services/job-queue/job-queue.service.ts (0 hunks)
  • apps/notifications/package.json (1 hunks)
  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.spec.ts (0 hunks)
  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.ts (1 hunks)
  • apps/notifications/src/infrastructure/broker/services/broker/broker.service.spec.ts (1 hunks)
  • apps/notifications/src/infrastructure/broker/services/broker/broker.service.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.spec.ts
  • apps/api/src/core/services/job-queue/job-queue.service.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/notifications/src/infrastructure/broker/services/broker/broker.service.spec.ts
  • apps/notifications/src/infrastructure/broker/services/broker/broker.service.ts
  • apps/notifications/package.json
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Never use type any or cast to type any. Always define the proper TypeScript types.

Files:

  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

**/*.{js,ts,tsx}: Never use deprecated methods from libraries.
Don't add unnecessary comments to the code

Files:

  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.ts
🧠 Learnings (1)
📚 Learning: 2025-07-27T12:16:08.566Z
Learnt from: CR
Repo: akash-network/console PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-07-27T12:16:08.566Z
Learning: Applies to **/*.{ts,tsx} : Never use type any or cast to type any. Always define the proper TypeScript types.

Applied to files:

  • apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: codecov/project/notifications
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
  • GitHub Check: validate / validate-app
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
  • GitHub Check: test-build
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
  • GitHub Check: test-build
  • GitHub Check: test-build
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
🔇 Additional comments (1)
apps/notifications/src/infrastructure/broker/providers/pg-boss/pg-boss.provider.ts (1)

17-23: Now I need to verify the actual file content to ensure the review comment is based on the correct state:


The removal of archiveCompletedAfterSeconds is correct and properly implemented. The pg-boss Db interface itself requires the executeSql method with any[] for the values parameter, so implementing this custom db wrapper with the necessary any types is not a code violation—it's fulfilling the library's interface contract. The queue-level retention configuration via deleteAfterSeconds in createQueue calls is the proper pg-boss v11+ pattern and is correctly implemented in the codebase.

Likely an incorrect or invalid review comment.

@ygrishajev ygrishajev force-pushed the feature/notifications branch from bf25677 to ad213cc Compare November 10, 2025 15:57
const queueName = this.toQueueName(eventName);
await this.boss.createQueue(queueName);
await this.boss.createQueue(queueName, {
deleteAfterSeconds: this.configService.getOrThrow("broker.EVENT_BROKER_ARCHIVE_COMPLETED_AFTER_SECONDS")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought(non-blocking): one important difference in v1 is that pg-boss no longer partition jobs table by default and if you need to enable this behavior, it should be explicit. https://timgit.github.io/pg-boss/#/./api/queues

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants