Skip to content
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

[popup] Reduce the chances to hit limit on EntityDefinition query for large orgs #149

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## General

- Reduce the chances to hit limit on EntityDefinition query for large orgs [issue 138](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/138) (issue by [AjitRajendran](https://github.com/AjitRajendran))
- Add 'LIMIT 200' when selecting 'FIELDS(' in autocomplete [issue 146](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/146) )
- Change method to get extension id to be compatible with firefox [issue 137](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/137) (issue by [kkorynta](https://github.com/kkorynta))
- Fix hardcoded browser in Generate Token url [issue 137](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/137) (issue by [kkorynta](https://github.com/kkorynta))
Expand Down
5 changes: 3 additions & 2 deletions addon/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,9 @@ class AllDataBox extends React.PureComponent {
// We cannot use limit and offset to work around it, since EntityDefinition does not support those according to the documentation, and they seem to work in a querky way in practice.
// Tried to use http://salesforce.stackexchange.com/a/22643, but "order by x" uses AaBbCc as sort order, while "where x > ..." uses sort order ABCabc, so it does not work on text fields, and there is no unique numerical field we can sort by.
// Here we split the query into a somewhat arbitrary set of fixed buckets, and hope none of the buckets exceed 2000 records.
getEntityDefinitions(" where QualifiedApiName < 'M' limit 2000"),
getEntityDefinitions(" where QualifiedApiName >= 'M' limit 2000"),
getEntityDefinitions(" WHERE QualifiedApiName < 'M' LIMIT 2000"),
getEntityDefinitions(" WHERE QualifiedApiName >= 'M' AND QualifiedApiName < 'U' LIMIT 2000"),
getEntityDefinitions(" WHERE QualifiedApiName >= 'U' LIMIT 2000"),
])
.then(() => {
// TODO progressively display data as each of the three responses becomes available
Expand Down