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
Side-loading large quantities of associated records raises 414 (Request-URI Too Large) #651
Comments
There is a related PR submitted: #531 I tried this at work, but I encountered application freeze during load of about 1000 models using App.MyModel.find(). But considering your use case, it could probably work. |
What is the status on this? I have a large number of IDs that need updating. I would love a safe batch size for the URL and just get all the data in batches... not possible yet? |
This is a good idea. I'll move it into the Beta 2 milestone. |
Note that the server can also return a URL for the association in {
"post": {
"id": 1,
"title": "Rails is omakase",
"links": {
"comments": "/posts/1/comments"
}
}
} |
That would bypass the URL problems encountered in large hasMany On Monday, September 2, 2013, Yehuda Katz wrote:
|
Closed in favor of association URLs for large collections. |
@wycats Should using
|
Ok, aftert digging into the ember-data code it seems one has to set the
Then it works... :) |
While I understand the rationale behind choosing this is a much better solution to issues like #804 , it feels very much like it's a bug to leave ember ABLE to load more objects than can fit on a single URL request. I'm currently experiencing this problem because of not being able to turn on the links feature because it doens't work in my case (a bug referenced and possibly fixed by #1791)... so I'm left with an app that silently crashes sometimes. :( I'm getting 400's atthe JS level because of the requests being too long to fit within a single line. I may have to implement @abdul's "hacky solution" from #241 I guess) |
This will be fixed soon by the findCoalescing branch |
I ended up rewriting my adapter's findMany...:
|
I still think punting this choice to users by default (rather than make it impossible to do something stupid) is a bad decision, but perhaps I'm not fully following the new default behaviour. |
This PR brings following improvements/changes: 1. Find calls from the same runloop will be coalesced into findMany requests if the adapter has a findMany method 2. Adds a groupRecordsForFindMany hook on the adapter that allows you to decide how to coalesce the record requests. This will enable fixing of bugs such as #651, by segmenting on the number of records 3. Allows users to preset attributes and relationships on a model when doing a find call. For relationships you can either pass in a record or an id 4. Gives rudimentary support for nested urls, by passing in the record object to the buildUrl method 5. Removes the owner being passed to findMany becuase it can be looked up on the original record 6. Adds couple special cased SSOT features that were needed for buildUrl/removal of owner property to be viable This PR lays the groundwork for: 1. Adding support for reloading hasManys 2. Making nice sugar for nestedUrls in the RestAdater
This PR brings following improvements/changes: 1. Find calls from the same runloop will be coalesced into findMany requests if the adapter has a findMany method 2. Adds a groupRecordsForFindMany hook on the adapter that allows you to decide how to coalesce the record requests. This will enable fixing of bugs such as #651, by segmenting on the number of records 3. Allows users to preset attributes and relationships on a model when doing a find call. For relationships you can either pass in a record or an id 4. Gives rudimentary support for nested urls, by passing in the record object to the buildUrl method 5. Removes the owner being passed to findMany becuase it can be looked up on the original record 6. Adds couple special cased SSOT features that were needed for buildUrl/removal of owner property to be viable This PR lays the groundwork for: 1. Adding support for reloading hasManys 2. Making nice sugar for nestedUrls in the RestAdater
This PR brings following improvements/changes: 1. Find calls from the same runloop will be coalesced into findMany requests if the adapter has a findMany method 2. Adds a groupRecordsForFindMany hook on the adapter that allows you to decide how to coalesce the record requests. This will enable fixing of bugs such as #651, by segmenting on the number of records 3. Allows users to preset attributes and relationships on a model when doing a find call. For relationships you can either pass in a record or an id 4. Gives rudimentary support for nested urls, by passing in the record object to the buildUrl method 5. Removes the owner being passed to findMany becuase it can be looked up on the original record 6. Adds couple special cased SSOT features that were needed for buildUrl/removal of owner property to be viable This PR lays the groundwork for: 1. Adding support for reloading hasManys 2. Making nice sugar for nestedUrls in the RestAdater
This PR brings following improvements/changes: 1. Find calls from the same runloop will be coalesced into findMany requests if the adapter has a findMany method 2. Adds a groupRecordsForFindMany hook on the adapter that allows you to decide how to coalesce the record requests. This will enable fixing of bugs such as #651, by segmenting on the number of records 3. Allows users to preset attributes and relationships on a model when doing a find call. For relationships you can either pass in a record or an id 4. Gives rudimentary support for nested urls, by passing in the record object to the buildUrl method 5. Removes the owner being passed to findMany becuase it can be looked up on the original record 6. Adds couple special cased SSOT features that were needed for buildUrl/removal of owner property to be viable This PR lays the groundwork for: 1. Adding support for reloading hasManys 2. Making nice sugar for nestedUrls in the RestAdater
This PR brings following improvements/changes: 1. Find calls from the same runloop will be coalesced into findMany requests if the adapter has a findMany method 2. Adds a groupRecordsForFindMany hook on the adapter that allows you to decide how to coalesce the record requests. This will enable fixing of bugs such as #651, by segmenting on the number of records 3. Allows users to preset attributes and relationships on a model when doing a find call. For relationships you can either pass in a record or an id 4. Gives rudimentary support for nested urls, by passing in the record object to the buildUrl method 5. Removes the owner being passed to findMany becuase it can be looked up on the original record 6. Adds couple special cased SSOT features that were needed for buildUrl/removal of owner property to be viable This PR lays the groundwork for: 1. Adding support for reloading hasManys 2. Making nice sugar for nestedUrls in the RestAdater
This PR brings following improvements/changes: 1. Find calls from the same runloop will be coalesced into findMany requests if the adapter has a findMany method 2. Adds a groupRecordsForFindMany hook on the adapter that allows you to decide how to coalesce the record requests. This will enable fixing of bugs such as #651, by segmenting on the number of records 3. Allows users to preset attributes and relationships on a model when doing a find call. For relationships you can either pass in a record or an id 4. Gives rudimentary support for nested urls, by passing in the record object to the buildUrl method 5. Removes the owner being passed to findMany becuase it can be looked up on the original record 6. Adds couple special cased SSOT features that were needed for buildUrl/removal of owner property to be viable This PR lays the groundwork for: 1. Adding support for reloading hasManys 2. Making nice sugar for nestedUrls in the RestAdater
This PR brings following improvements/changes: 1. Find calls from the same runloop will be coalesced into findMany requests if the adapter has a findMany method 2. Adds a groupRecordsForFindMany hook on the adapter that allows you to decide how to coalesce the record requests. This will enable fixing of bugs such as #651, by segmenting on the number of records 3. Allows users to preset attributes and relationships on a model when doing a find call. For relationships you can either pass in a record or an id 4. Gives rudimentary support for nested urls, by passing in the record object to the buildUrl method 5. Removes the owner being passed to findMany becuase it can be looked up on the original record 6. Adds couple special cased SSOT features that were needed for buildUrl/removal of owner property to be viable This PR lays the groundwork for: 1. Adding support for reloading hasManys 2. Making nice sugar for nestedUrls in the RestAdater
This PR brings following improvements/changes: 1. Find calls from the same runloop will be coalesced into findMany requests if the adapter has a findMany method 2. Adds a groupRecordsForFindMany hook on the adapter that allows you to decide how to coalesce the record requests. This will enable fixing of bugs such as #651, by segmenting on the number of records 3. Allows users to preset attributes and relationships on a model when doing a find call. For relationships you can either pass in a record or an id 4. Gives rudimentary support for nested urls, by passing in the record object to the buildUrl method 5. Removes the owner being passed to findMany becuase it can be looked up on the original record 6. Adds couple special cased SSOT features that were needed for buildUrl/removal of owner property to be viable This PR lays the groundwork for: 1. Adding support for reloading hasManys 2. Making nice sugar for nestedUrls in the RestAdater
Fixed by @jcollins1991 |
The API my app talks to uses 128bit UUIDs for IDs, and we get a lot of them. This causes the server to reject the request to side-load even a relatively small quantity of records (~100) because the request URI is so large it seems to exceed a server-side limit.
Now I'm not sure precisely what the limit is, although I've heard it's around 4096 chars.
Is there a way to only side-load small batches, say 10 at a time, or as needed?
The text was updated successfully, but these errors were encountered: