forked from graphiti-api/graphiti
-
Notifications
You must be signed in to change notification settings - Fork 0
Merge from graphiti-api/graphiti master #1
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
Open
CathyRye
wants to merge
303
commits into
agworld:edge
Choose a base branch
from
graphiti-api:master
base: edge
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We didn't have a version lock on standardrb, and since it's still pre-1.0, a lot of the default rules are changing, which means it introduces breakages to our tests. This locks the version to the latest as of now and applys the fixes to get it passing
Fix standard lint errors; lock version
If an active_record has_many association provides the `inverse_of` option, we can infer better filter name for the opposite side of a many_to_many relationship
…e-record-adapter Fix: filter_datetime_eq method in ActiveRecord adapter doesn't supprt nil
bump version
The Debugger was adding data to the chunks Array via the ActiveSupport::Notification handlers `on_data`, and `on_render`. When the debugger is disabled, this Array is never flushed, and it is not GC'd since it's referenced in a class instance variable. This change returns early in both event handlers if the debugger is not enabled. We also mark the utility methods in the debugger as private so they cannot be accessed outside of the class (and add data to chunks).
Patch memory leak in Graphiti::Debugger.
There's some larger refactoring needed but this is the simplest possible fix for the issue. There are three overall problems with the validator: * Called for read operations, but meant to validate writes. I'm not sure why this was ever the case, perhaps to eventually validate reads as well. * Called in multiple places (proxy and runner) * References `params[:action]`, which couples us to Rails So the ideal refactoring would be to only call the validator within `ResourceProxy#save`, which addresses all the above. The problem is one specific test looks at the metadata of a sideposted resource (occasionally it's helpful to see things like "what parent object is sideposting me"). Because read operations would go through the validator and `id` would be typecast, this test now fails because it sees `id` as a string instead of an integer, because it is no longer being typecast. I think I'm fine just updating the spec, but again this PR is to do the simplest thing possible. So I instead added the very specific logic "if validating id, and not a create operation, AND id is not writable, don't attempt to typecast". The larger refactoring can come later. Finally, the other future refactoring would be to avoid merging `id` into `attributes` when not a create operation. Part of the issue here is the deserializer is called even on reads (per above), which complicates things further. So a good future approach would be to only call the validator within `ResourceProxy#save`, then address deserialization separately afterwards.
If you were passing a scope override for an update or destroy operation, that scope wouldn't be properly honored. This PR ensures an error will be correctly thrown if no record is found. The downside is we look up the record twice, now, but I think we should get a fix in ASAP.
Ensure scope override is honored on update/destroy
Avoid need for writable PK on update
bump version
Fix specs
Fix specs
Fix conditional rendering of an extra_attribute (:readable)
bump version
Infer inverse_filter from `inverse_of`
bump version
This was causing some pretty extreme performance problems for a couple of our users, and it seems I've been the only one to ever encounter this strange edge case, which is easy enough to override in my specific resource in the two places I've seen it.
If we are trying to filter a resource by an id attribute but that attribute is nil, we should raise an error. If we allow the resource resolution to continue, the result will be an empty "where" clause and taking the first result. This is a problem when sending `null` as the relationship ID on a CREATE or UPDATE, as it would just associate (and update!) the first record returned by the unscoped where clause. We should probably have a check further up the stack as well in the request validator or similar, but this at least puts a quick stop to the issue and blows up these invalid requests while we take time to make a more pleasant experience for API consumers.
…o the current time
## [1.7.1](v1.7.0...v1.7.1) (2024-04-18) ### Bug Fixes * properly display .find vs .all in debugger statements ([d2a7a03](d2a7a03)) * rescue error from sideloads updated_at calculation, defaulting to the current time ([661e3b5](661e3b5))
* fix: require necessary ActiveSupport parts in proper order * fix: make gem compatible with older ActiveSupport versions
## [1.7.2](v1.7.1...v1.7.2) (2024-06-11) ### Bug Fixes * require necessary ActiveSupport parts in proper order ([bb2a488](bb2a488))
## [1.7.3](v1.7.2...v1.7.3) (2024-06-26) ### Bug Fixes * require OpenStruct explicitly ([#475](#475)) ([e0fa18a](e0fa18a))
In ActiveRecord 7.2 the `clear_active_connections` was (re)moved to the `connection_handler` property.
## [1.7.4](v1.7.3...v1.7.4) (2024-09-11) ### Bug Fixes * update ActiveRecord adapter w/ support for Rails 7.2+ ([#478](#478)) ([8313e33](8313e33))
## [1.7.6](v1.7.5...v1.7.6) (2024-11-06) ### Bug Fixes * Gem version check ([#483](#483)) ([68e2492](68e2492))
## [1.7.7](v1.7.6...v1.7.7) (2025-03-15) ### Bug Fixes * change class attribute behavior on endpoint method to work in ruby 3.2+ ([#493](#493)) ([04f1f3c](04f1f3c))
…fix to the intersection model association (#449)
## [1.7.8](v1.7.7...v1.7.8) (2025-03-16) ### Bug Fixes * compare URI-decoded path params ([#482](#482)) ([20b80dd](20b80dd)) * correct issue with many_to_many when one of the models has a prefix to the intersection model association ([#449](#449)) ([dc28a4f](dc28a4f)) * lazy constantize relation resources ([#492](#492)) ([3cc2983](3cc2983))
## [1.7.9](v1.7.8...v1.7.9) (2025-03-16) ### Bug Fixes * update version check for clear active connections active record deprecation ([#491](#491)) ([4e764f6](4e764f6))
…472) Previously, sideloading in Graphiti used an unbounded number of threads, which could decrease performance due to resource contention and exhaust the ActiveRecord connection pool, leading to timeouts and connection errors. This commit introduces a thread pool based on ActiveRecord's global_thread_pool_async_query_executor, limiting the maximum number of resources that can be sideloaded concurrently. With a properly configured connection pool, this ensures that the ActiveRecord connection pool is not exhausted by the sideloading process.
# [1.8.0](v1.7.9...v1.8.0) (2025-03-17) ### Features * add thread pool with promises to limit concurrent sideloading ([#472](#472)) ([2998852](2998852))
## [1.8.1](v1.8.0...v1.8.1) (2025-03-17)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.