-
Notifications
You must be signed in to change notification settings - Fork 640
feat: dataconnect: DataConnectOperationException added to support partial errors #6794
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
Conversation
…se DataConnectOperationException instead of DataConnectException
📝 PRs merging into main branchOur main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released. |
1 similar comment
📝 PRs merging into main branchOur main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released. |
Coverage Report 1Affected Products
Test Logs |
The public api surface has changed for the subproject firebase-dataconnect_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
1 similar comment
The public api surface has changed for the subproject firebase-dataconnect_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
Test Results 66 files + 2 66 suites +2 1m 16s ⏱️ +4s Results for commit 3b00fb4. ± Comparison against base commit 75be716. This pull request removes 40 and adds 50 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Size Report 1Affected Products
Test Logs |
The public api surface has changed for the subproject firebase-dataconnect_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
# Conflicts: # firebase-dataconnect/CHANGELOG.md
The public api surface has changed for the subproject firebase-dataconnect_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
4 similar comments
The public api surface has changed for the subproject firebase-dataconnect_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-dataconnect_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-dataconnect_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-dataconnect_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
The public api surface has changed for the subproject firebase-dataconnect_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
1 similar comment
The public api surface has changed for the subproject firebase-dataconnect_api.txt: Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly. |
There are two failing GitHub Actions, both of which ave been identified as false positives:
|
...nnect/src/main/kotlin/com/google/firebase/dataconnect/DataConnectOperationFailureResponse.kt
Outdated
Show resolved
Hide resolved
…reResponse.ErrorInfo.PathSegment moved to a top-level class
This PR adds the
DataConnectOperationException
class, a subclass of the previously-existingDataConnectException
class. This newDataConnectOperationException
class is thrown by invocations ofQueryRef.execute()
andMutationRef.execute()
in the case where a response is received from the backend, but the response indicates that the operation could not be executed to completion, including the case that the client SDK fails to decode the response to a higher-level object. Other kinds of errors, such as networking errors, will still be reported as they were previously.Client code can catch
DataConnectOperationException
and check itsresponse
property to get details about any errors that occurred and any data that was received. If the data was able to be decoded, despite the errors, then it will be available. Also the "raw" data (aMap<String, Any?>
) property will give access to the raw, undecoded data, if any was sent from the backend.This feature is intended to support "partial errors", where an operation can partially succeed and partially fail, and the client application wants to take some special behavior in the case of a partial success.
For example, suppose this database schema and connector definition:
Here is some code that handles the partial error that will occur if this mutation were to ever be executed: