-
Notifications
You must be signed in to change notification settings - Fork 1
fix(schema-polling): improve polling #237
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: main
Are you sure you want to change the base?
Conversation
… fetch and current schema tracking
- Disable Naming/PredicateMethod cop for start() method (false positive) - Remove redundant begin block in fetch_initial_schema_sync - Use single quotes for static strings - Extract etag_info variable to fix line length violation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
Coverage Impact ⬆️ Merging this pull request will increase total coverage on Modified Files with Diff Coverage (2)
🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|
packages/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc.rb
Outdated
Show resolved
Hide resolved
Co-authored-by: dogan.ay <[email protected]>
## Changes ### Merge conflicts resolved - Integrated introspection fallback feature from main (PR #238) - Preserved schema polling improvements from this branch ### Schema polling enhancements - SchemaPollingClient now computes ETag locally using same algorithm as RPC slave (SHA1) - Added previous_schema parameter to initialize() for better startup resilience - ETag is computed from schema content instead of relying on server response - Ensures consistent ETag comparison between master and slave ### Cleanup - Removed obsolete SSE cleanup hooks (setup_cleanup_hooks method) - Polling thread cleanup is automatic, no need for manual signal handlers ### Integration with introspection feature - SchemaPollingClient receives provided_introspection as previous_schema - Falls back to introspection if RPC slave is unreachable at startup - Maintains schema polling for live updates once slave becomes available 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
2 new issues
|
...s/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/Utils/schema_polling_client.rb
Outdated
Show resolved
Hide resolved
- Fix RuboCop Style/RedundantAssignment offense - Return datasource directly instead of assigning then returning
- Add 'require digest' at the top of schema_polling_client.rb - Remove inline requires from compute_etag method - Fixes initialization issues when digest is not yet loaded
...s/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/Utils/schema_polling_client.rb
Outdated
Show resolved
Hide resolved
…g for RPC datasource
...s/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/Utils/schema_polling_client.rb
Outdated
Show resolved
Hide resolved
…n and error handling
...s/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/Utils/schema_polling_client.rb
Outdated
Show resolved
Hide resolved
…l sync completion
...s/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/Utils/schema_polling_client.rb
Outdated
Show resolved
Hide resolved
...s/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/Utils/schema_polling_client.rb
Outdated
Show resolved
Hide resolved
...s/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/Utils/schema_polling_client.rb
Outdated
Show resolved
Hide resolved
…trap context errors
...s/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/Utils/schema_polling_client.rb
Outdated
Show resolved
Hide resolved
...s/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/Utils/schema_polling_client.rb
Outdated
Show resolved
Hide resolved
...s/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/Utils/schema_polling_client.rb
Outdated
Show resolved
Hide resolved
405ecb7 to
8d0da82
Compare
...s/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/Utils/schema_polling_client.rb
Outdated
Show resolved
Hide resolved
8d0da82 to
4053f38
Compare
...s/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/Utils/schema_polling_client.rb
Outdated
Show resolved
Hide resolved
| MAX_POLLING_INTERVAL = 3600 | ||
|
|
||
| def initialize(uri, auth_secret, options = {}, &on_schema_change) | ||
| def initialize(uri, auth_secret, options = {}, introspection_schema = nil, &on_schema_change) |
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.
...s/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/Utils/schema_polling_client.rb
Show resolved
Hide resolved
a3213ac to
f62484a
Compare
...s/forest_admin_datasource_rpc/lib/forest_admin_datasource_rpc/Utils/schema_polling_client.rb
Show resolved
Hide resolved
| @introspection_schema = nil | ||
| rescue Faraday::ConnectionFailed, Faraday::TimeoutError, | ||
| ForestAdminAgent::Http::Exceptions::AuthenticationOpenIdClient, StandardError => e | ||
| handle_initial_fetch_error(e) |
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.

PR qui fais que le build de datasource RPC n'appelle pas get schema directement.
C'est le polling qui est utilisé dès le départ pour fetch
Definition of Done
General
Security