[cloud_firestore] Fix stream error report on iOS #2305
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #185.
On iOS, there were no reports about stream error.
For
"Query#addSnapshotListener"
and"DocumentReference#addSnapshotListener"
, error should be sent by calling[weakSelf.channel invokeMethod:]
, notresult()
.Calling
result()
doesn't make sense for this case.On Android, it also doesn't send error, but
System.out.println(e)
is called instead:iOS's behavior should follow this.
And, It is very useful to know what error was occurred and how to fix it from the error log.
Typical error for this is index error like this, so printing the error is enough in most cases.
Of course, it is better to send error to dart side, so
// TODO: send error
is reasonable.Related Issues
#185, as mentioned above.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
I cannot determin whether this is breaking change or not, but I think "no" because calling
result()
didn't make sense andNSLog
was just added.