-
Notifications
You must be signed in to change notification settings - Fork 400
feat: enableEventEngine, restore set default #495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
24f42e4
40d1274
08e3e88
339f67d
c2cb407
5b035ae
e24a14e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json | ||
|
|
||
| language: en-US | ||
|
|
||
| reviews: | ||
| # Enable high-level summary of changes | ||
| high_level_summary: false | ||
|
|
||
| # Add a poem... just kidding, disable it | ||
| poem: false | ||
|
|
||
| # Collapse walkthrough to keep PR comments clean | ||
| collapse_walkthrough: true | ||
|
|
||
| # Auto-review on every push | ||
| auto_review: | ||
| enabled: true | ||
| drafts: true | ||
|
|
||
| # Path-based review instructions | ||
| path_instructions: | ||
| - path: "src/core/**" | ||
| instructions: | | ||
| This is the core SDK module. Pay close attention to: | ||
| - Backward compatibility of public API changes | ||
| - Proper TypeScript typing (strict mode is enabled) | ||
| - No platform-specific code (Node.js, Web, React Native specifics belong in their respective platform directories) | ||
| - Thread safety considerations for shared state | ||
| - path: "src/core/endpoints/**" | ||
| instructions: | | ||
| These are REST API endpoint implementations. Review for: | ||
| - Correct request/response type definitions | ||
| - Proper error handling and status code mapping | ||
| - Consistent parameter validation | ||
| - Adherence to PubNub REST API contracts | ||
| - path: "src/core/types/**" | ||
| instructions: | | ||
| TypeScript type definitions. Ensure: | ||
| - Types are precise and not overly permissive (avoid `any`) | ||
| - Exported types maintain backward compatibility | ||
| - Proper use of generics and utility types | ||
| - path: "src/event-engine/**" | ||
| instructions: | | ||
| State-machine-based subscription management. Review for: | ||
| - Correct state transitions and edge cases | ||
| - No leaked subscriptions or event listeners | ||
| - Proper cleanup on state exit | ||
| - path: "src/entities/**" | ||
| instructions: | | ||
| High-level subscription API (Channel, ChannelGroup, etc.). Review for: | ||
| - Proper event handler lifecycle management | ||
| - Memory leak prevention (listener cleanup) | ||
| - path: "src/transport/**" | ||
| instructions: | | ||
| Platform-specific HTTP transport implementations. Review for: | ||
| - Proper timeout and cancellation handling | ||
| - Correct header management | ||
| - Error propagation consistency across platforms | ||
| - path: "src/node/**" | ||
| instructions: "Node.js platform implementation. Ensure no browser/DOM APIs are used." | ||
| - path: "src/web/**" | ||
| instructions: "Browser platform implementation. Ensure no Node.js-specific APIs (fs, crypto, etc.) are used." | ||
| - path: "src/react_native/**" | ||
| instructions: "React Native platform implementation. Verify compatibility with RN runtime." | ||
| - path: "test/**" | ||
| instructions: | | ||
| Test files. Review for: | ||
| - Adequate coverage of edge cases | ||
| - Proper use of mocks/stubs (Sinon + Nock) | ||
| - No flaky patterns (hardcoded timeouts, race conditions) | ||
| - Tests that actually assert meaningful behavior | ||
|
|
||
| # Tools configuration | ||
| tools: | ||
| # Enable GitHub checks integration | ||
| github-checks: | ||
| enabled: true | ||
| timeout_ms: 120000 | ||
|
|
||
| chat: | ||
| auto_reply: true | ||
|
|
||
| knowledge_base: | ||
| mcp: | ||
| usage: enabled | ||
|
|
||
| # Path filters - ignore generated/vendored/build output | ||
| path_filters: | ||
| # Build outputs | ||
| - "!dist/**" | ||
| - "!lib/**" | ||
| - "!upload/**" | ||
|
|
||
| # Dependencies | ||
| - "!node_modules/**" | ||
|
|
||
| # Lock files - too noisy, low review value | ||
| - "!package-lock.json" | ||
|
|
||
| # Config/metadata that rarely needs review | ||
| - "!.pubnub.yml" | ||
| - "!.vscode/**" | ||
|
|
||
| # Generated type bundles | ||
| - "!lib/types/**" | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ const USE_SSL = true; | |
| /** | ||
| * Whether PubNub client should catch up subscription after network issues. | ||
| */ | ||
| const RESTORE = false; | ||
| const RESTORE = true; | ||
| /** | ||
| * Whether network availability change should be announced with `PNNetworkDownCategory` and | ||
| * `PNNetworkUpCategory` state or not. | ||
|
|
@@ -37,7 +37,7 @@ const FILE_PUBLISH_RETRY_LIMIT = 5; | |
| /** | ||
| * Whether subscription event engine should be used or not. | ||
| */ | ||
| const ENABLE_EVENT_ENGINE = false; | ||
| const ENABLE_EVENT_ENGINE = true; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check that tests and docs were updated for the new default, and look for any spots
# that still hardcode or assume enableEventEngine=false as the default.
rg -nP -C2 'enableEventEngine' --type=ts --type=js -g '!**/node_modules/**' -g '!dist/**'
rg -nP -C2 'ENABLE_EVENT_ENGINE\s*=' -g '!**/node_modules/**'
fd -i 'changelog|migration' -t f | head -20Repository: pubnub/javascript Length of output: 18640 🏁 Script executed: # Check CHANGELOG.md for BREAKING CHANGE note about ENABLE_EVENT_ENGINE
head -100 CHANGELOG.md | grep -A 5 -B 5 -i "breaking\|event.engine"
# Look for migration guides
fd -i 'migration\|upgrade\|guide' -t f | head -20
# Check if lib/ files are generated (look for build scripts)
cat -n package.json | head -50
# Compare timestamps of src and lib files to verify regeneration
ls -la src/core/interfaces/configuration.ts lib/core/interfaces/configuration.js 2>/dev/null || echo "Files not found"
stat src/core/interfaces/configuration.ts lib/core/interfaces/configuration.js 2>/dev/null | grep -E "File|Modify"Repository: pubnub/javascript Length of output: 4667 🏁 Script executed: # Search entire CHANGELOG for enableEventEngine or event engine breaking change
grep -i "enableeventengine\|event.engine" CHANGELOG.md | head -20
# Search more broadly for breaking changes in recent versions
grep -B2 -A5 "BREAKING CHANGE" CHANGELOG.md | head -40
# Look for docs directory with migration/guide info
fd -i 'docs' -t d | head -10
# Check if there's a docs directory with migration guides
find . -type f -name "*.md" -path "*/docs/*" 2>/dev/null | grep -i "migrat\|upgrade\|guide\|breaking" | head -20
# Count tests with enableEventEngine: true vs false
echo "=== Tests with enableEventEngine: true ==="
rg 'enableEventEngine:\s*true' --type=ts --type=js test/ -c
echo "=== Tests with enableEventEngine: false ==="
rg 'enableEventEngine:\s*false' --type=ts --type=js test/ -cRepository: pubnub/javascript Length of output: 2212 Add explicit "BREAKING CHANGE" documentation for The three behavioral cascades identified are correctly implemented:
Tests provide coverage for both However, Add these documentation updates to surface the behavioral change to users upgrading to this version. 🤖 Prompt for AI Agents |
||
| /** | ||
| * Whether configured user presence state should be maintained by the PubNub client or not. | ||
| */ | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path_filtersis at the wrong nesting level — filters will not apply.Per the CodeRabbit configuration schema,
path_filterslives underreviews, not at the top level. As written here, these exclusions are effectively ignored, sodist/**,lib/**,node_modules/**,package-lock.json, etc. will still be pulled into reviews — defeating the intent of this block.🛠️ Proposed fix: move
path_filtersunderreviews# Tools configuration tools: # Enable GitHub checks integration github-checks: enabled: true timeout_ms: 120000 + # Path filters - ignore generated/vendored/build output + path_filters: + # Build outputs + - "!dist/**" + - "!lib/**" + - "!upload/**" + # Dependencies + - "!node_modules/**" + # Lock files - too noisy, low review value + - "!package-lock.json" + # Config/metadata that rarely needs review + - "!.pubnub.yml" + - "!.vscode/**" + # Generated type bundles + - "!lib/types/**" + chat: auto_reply: true knowledge_base: mcp: usage: enabled - -# Path filters - ignore generated/vendored/build output -path_filters: - # Build outputs - - "!dist/**" - - "!lib/**" - - "!upload/**" - - # Dependencies - - "!node_modules/**" - - # Lock files - too noisy, low review value - - "!package-lock.json" - - # Config/metadata that rarely needs review - - "!.pubnub.yml" - - "!.vscode/**" - - # Generated type bundles - - "!lib/types/**"Also worth noting:
!lib/**already covers!lib/types/**, so the last entry is redundant once relocated.📝 Committable suggestion
🤖 Prompt for AI Agents