Skip to content

fix(datastore): Various integration bug fixes #4954

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

Merged
merged 20 commits into from
Jun 3, 2024

Conversation

Equartey
Copy link
Contributor

@Equartey Equartey commented May 31, 2024

Description of changes:

  • This resolves multi auth issues by enabling the auth mode to be passed from the Swift project to Flutter.
  • Modifies subscription stream errors to conform to Swift's error Json structure.
  • Improves decoding logic by passing modelName which should always have a value.
  • Fix for cancellables crash
  • GraphQL requests response now match AppSync response payloads
  • Fix to allow initial sync to complete when a model does not have sufficient permissions before a user is signed in

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Equartey Equartey requested a review from a team as a code owner May 31, 2024 14:49
/// If the response has errors, the event type will be `error`, otherwise `data`
void sendSubscriptionEvent(
String subscriptionId, GraphQLResponse<String> response) {
final payloadJson = response.hasErrors
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend reusing sendNativeErrorEvent with the encoded error json if the response has errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion, updated.

@Equartey Equartey changed the title fix(datastore): pass auth mode from swift fix(datastore): Various integration bug fixes May 31, 2024
) { a, _ in a }
}.map { JSONValue.object($0) } ?? dataPayload

/// This is included to allow multi-platform support. Requests that do not have `__typename`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: Was there supposed to be more to this comment? I am not following the second sentence.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, yah reads like a fragment 😅 Updated.

@Equartey Equartey merged commit f1aef19 into feat/datastore-spm-migration Jun 3, 2024
13 checks passed
@Equartey Equartey deleted the fix/spm-auth-mode branch June 3, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants