PromucFlow_constructor/app/server/appsmith-plugins
Rishabh Rathod 45172ac8ae
fix: firestore pagination issue (#32912)
## Description

As per the documentation the where clause must always come before the
order by clause, and the startAfter clause must come after the order by
clause i.e the recommended order : `where clause --> order by --> start
after`. However, the way code was written it applies the where clause
after the startAfter i.e as per the code : `order by --> start after -->
where clause` .

In this PR, we change the logic to make sure we follow the order `where
clause -> order by and startAfter / endBefore` when generating query.

Fixes https://github.com/appsmithorg/appsmith/issues/32604

documentation link. -
https://firebase.google.com/docs/firestore/query-data/query-cursors

Changes were taken from the PR created by @sumitsum here
https://github.com/appsmithorg/appsmith-ee/pull/4001




## Automation

/ok-to-test tags="@tag.Datasource"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8814737910>
> Commit: 4c7ed97cc1808a537d40682fc0e930cd0e30be70
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8814737910&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->




## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Improved the order of operations in Firestore queries to enhance query
performance and reliability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-04-29 11:23:34 +05:30
..
amazons3Plugin fix: commands title changed to command for each datasource query editor forms (#32526) 2024-04-10 17:05:01 +05:30
anthropicPlugin feat: Vision models support in Anthropic (#32103) 2024-04-16 13:41:28 +00:00
appsmithAiPlugin chore: Add after delete hook for Appsmith AI datasource (#31466) 2024-03-19 12:52:32 +05:30
arangoDBPlugin fix: reverting the default port numbers for the datasources (#32726) 2024-04-17 13:44:18 +05:30
awsLambdaPlugin fix: commands title changed to command for each datasource query editor forms (#32526) 2024-04-10 17:05:01 +05:30
databricksPlugin fix: Making userTag a hidden field to not expose it as a user configurable option with Appsmith being the default value (#31792) 2024-03-14 16:18:44 +05:30
dynamoPlugin chore: Applied Spotless formatter (#25173) 2023-07-07 00:43:11 +05:30
elasticSearchPlugin fix: reverting the default port numbers for the datasources (#32726) 2024-04-17 13:44:18 +05:30
firestorePlugin fix: firestore pagination issue (#32912) 2024-04-29 11:23:34 +05:30
googleAiPlugin fix: commands title changed to command for each datasource query editor forms (#32526) 2024-04-10 17:05:01 +05:30
googleSheetsPlugin fix: graphQL bindings issue resolved (#32760) 2024-04-18 17:36:54 +05:30
graphqlPlugin ci: Publish port 4200 for TED (#32835) 2024-04-22 10:33:07 +05:30
jsPlugin chore: Applied Spotless formatter (#25173) 2023-07-07 00:43:11 +05:30
mongoPlugin fix: graphQL bindings issue resolved (#32760) 2024-04-18 17:36:54 +05:30
mssqlPlugin fix: reverting the default port numbers for the datasources (#32726) 2024-04-17 13:44:18 +05:30
mysqlPlugin fix: graphQL bindings issue resolved (#32760) 2024-04-18 17:36:54 +05:30
openAiPlugin chore: Fix warnings on @EqualsAndHashCode (#32667) 2024-04-15 13:46:37 +05:30
oraclePlugin fix: reverting the default port numbers for the datasources (#32726) 2024-04-17 13:44:18 +05:30
postgresPlugin fix: reverting the default port numbers for the datasources (#32726) 2024-04-17 13:44:18 +05:30
redisPlugin fix: reverting the default port numbers for the datasources (#32726) 2024-04-17 13:44:18 +05:30
redshiftPlugin fix: reverting the default port numbers for the datasources (#32726) 2024-04-17 13:44:18 +05:30
restApiPlugin test: Add AssertJ for plugins, for better assertions (#31380) 2024-03-04 07:33:45 +05:30
saasPlugin fix: graphQL bindings issue resolved (#32760) 2024-04-18 17:36:54 +05:30
smtpPlugin fix: reverting the default port numbers for the datasources (#32726) 2024-04-17 13:44:18 +05:30
snowflakePlugin feat: Add isSuggested value to templates for all plugins (#26623) 2023-08-30 11:49:25 +01:00
pom.xml test: Add AssertJ for plugins, for better assertions (#31380) 2024-03-04 07:33:45 +05:30