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

[cloud_firestore] Sync failed when closing app #1343

Closed
PrismaSoftGC opened this issue Nov 1, 2019 · 5 comments
Closed

[cloud_firestore] Sync failed when closing app #1343

PrismaSoftGC opened this issue Nov 1, 2019 · 5 comments
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. type: bug Something isn't working

Comments

@PrismaSoftGC
Copy link

Sync failed when closing app

Every time I enter a bank information, I need to check if the name is correct, because I want this feature to work offline, so I can not have inconsistencies in the bank. So far as the code below is working the way I want. but in only one situation does the sync fail, which is when I press the app's back button until it closes. So when I turn on the internet the data is not synchronized.

Code :

  Firestore.instance
      .collection('Regiao')
      .where('idRegiao', isEqualTo: idRegiao)
      .snapshots()
      .listen((data){
        data.documents.forEach((doc) {

          Firestore.instance
            .collection('CadernoCampoDefensivo')
            .document(idCadernoCampo)
            .updateData({'regiao' : doc['nomeRegiao']})
            .then((_){});


        });
  });

Log Error:

D/NetworkManagementSocketTagger(30646): tagSocket(60) with statsTag=0xffffffff, statsUid=-1
D/FlutterNativeView(30646): FlutterView.send called on a detached view, channel=plugins.flutter.io/cloud_firestore
D/FlutterNativeView(30646): FlutterView.send called on a detached view, channel=plugins.flutter.io/cloud_firestore
D/FlutterNativeView(30646): FlutterView.send called on a detached view, channel=plugins.flutter.io/cloud_firestore
D/FlutterNativeView(30646): FlutterView.send called on a detached view, channel=plugins.flutter.io/cloud_firestore
D/FlutterNativeView(30646): FlutterView.send called on a detached view, channel=plugins.flutter.io/cloud_firestore
W/FlutterJNI(30646): Tried to send a platform message response, but FlutterJNI was detached from native C++. Could not send. Response ID: 232

@PrismaSoftGC PrismaSoftGC added the type: bug Something isn't working label Nov 1, 2019
@PrismaSoftGC
Copy link
Author

@kroikie Have you encountered this problem?

@iapicca
Copy link

iapicca commented Nov 5, 2019

Hi @PrismaSoftGC
can you please provide your updated flutter doctor -v?
Also, to better address the issue, would be helpful
if you could post a self contained app on github
or the steps to reproduce it.
Thank you

@iapicca iapicca added the blocked: customer-response Waiting for customer response, e.g. more information was requested. label Nov 5, 2019
@iapicca iapicca changed the title [<cloud_firestore>] <Sync failed when closing app> [cloud_firestore] Sync failed when closing app Nov 5, 2019
@PrismaSoftGC
Copy link
Author

Hi @PrismaSoftGC
can you please provide your updated flutter doctor -v?
Also, to better address the issue, would be helpful
if you could post a self contained app on github
or the steps to reproduce it.
Thank you

So unfortunately I can't post an app to gitHub because it's a commercial project, but it's a pretty simple operation. When I am offline I need to record information, and before that I search another collection to be able to save updated. Very well, I save the operation, and when I turn on the internet the data is synchronized as expected. But if I press back on the application until it closes, this synchronization fails terribly.

PS: Sorry for english because i am brazilian and i am using google translator

`C:\Users\crist>flutter doctor --verbose
[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [versão 10.0.18362.418], locale pt-BR)
• Flutter version 1.9.1+hotfix.6 at C:\src\flutter
• Framework revision 68587a0916 (7 weeks ago), 2019-09-13 19:46:58 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\crist\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.

[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 41.0.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.39.2)
• VS Code at C:\Users\crist\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.5.1

[!] Connected device
! No devices available

! Doctor found issues in 1 category.`

`C:\Users\crist>flutter run --verbose
[ +19 ms] executing: [C:\src\flutter] git log -n 1 --pretty=format:%H
[ +139 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[ +7 ms] 68587a0916366e9512a78df22c44163d041dd5f3
[ +2 ms] executing: [C:\src\flutter] git describe --match v*.. --first-parent --long --tags
[ +287 ms] Exit code 0 from: git describe --match v*.. --first-parent --long --tags
[ +2 ms] v1.9.1+hotfix.6-0-g68587a091
[ +23 ms] executing: [C:\src\flutter] git rev-parse --abbrev-ref --symbolic @{u}
[ +119 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ +2 ms] origin/stable
[ +1 ms] executing: [C:\src\flutter] git ls-remote --get-url origin
[ +91 ms] Exit code 0 from: git ls-remote --get-url origin
[ +1 ms] https://github.com/flutter/flutter.git
[ +157 ms] executing: [C:\src\flutter] git rev-parse --abbrev-ref HEAD
[ +62 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ +1 ms] stable
[ +53 ms] "flutter run" took 111ms.
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Do not run this command from the root of your git clone of Flutter.

#0 FlutterCommand.validateCommand (package:flutter_tools/src/runner/flutter_command.dart:568:9)

#1 RunCommand.validateCommand (package:flutter_tools/src/commands/run.dart:278:19)

#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:465:11)

#3 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:407:33)

#4 AppContext.run. (package:flutter_tools/src/base/context.dart:154:29)

#5 _rootRun (dart:async/zone.dart:1124:13)
#6 _CustomZone.run (dart:async/zone.dart:1021:19)
#7 _runZoned (dart:async/zone.dart:1516:10)
#8 runZoned (dart:async/zone.dart:1463:12)
#9 AppContext.run (package:flutter_tools/src/base/context.dart:153:18)

#10 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:397:20)
#11 CommandRunner.runCommand (package:args/command_runner.dart:197:27)

#12 FlutterCommandRunner.runCommand.
(package:flutter_tools/src/runner/flutter_command_runner.dart:402:21)

#13 AppContext.run. (package:flutter_tools/src/base/context.dart:154:29)

#14 _rootRun (dart:async/zone.dart:1124:13)
#15 _CustomZone.run (dart:async/zone.dart:1021:19)
#16 _runZoned (dart:async/zone.dart:1516:10)
#17 runZoned (dart:async/zone.dart:1463:12)
#18 AppContext.run (package:flutter_tools/src/base/context.dart:153:18)

#19 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:356:19)

#20 CommandRunner.run. (package:args/command_runner.dart:112:25)
#21 new Future.sync (dart:async/future.dart:224:31)
#22 CommandRunner.run (package:args/command_runner.dart:112:14)
#23 FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:242:18)
#24 run.. (package:flutter_tools/runner.dart:63:22)

#25 _rootRun (dart:async/zone.dart:1124:13)
#26 _CustomZone.run (dart:async/zone.dart:1021:19)
#27 _runZoned (dart:async/zone.dart:1516:10)
#28 runZoned (dart:async/zone.dart:1500:12)
#29 run. (package:flutter_tools/runner.dart:61:18)

#30 AppContext.run. (package:flutter_tools/src/base/context.dart:154:29)

#31 _rootRun (dart:async/zone.dart:1124:13)
#32 _CustomZone.run (dart:async/zone.dart:1021:19)
#33 _runZoned (dart:async/zone.dart:1516:10)
#34 runZoned (dart:async/zone.dart:1463:12)
#35 AppContext.run (package:flutter_tools/src/base/context.dart:153:18)

#36 runInContext (package:flutter_tools/src/context_runner.dart:59:24)

#37 run (package:flutter_tools/runner.dart:50:10)
#38 main (package:flutter_tools/executable.dart:65:9)

#39 main (file:///C:/src/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#40 _startIsolate. (dart:isolate-patch/isolate_patch.dart:303:32)
#41 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)`

@kroikie
Copy link
Collaborator

kroikie commented Nov 9, 2019

@PrismaSoftGC I have not seen this; are you able to reproduce this behavior with the example app for cloud_firestore?

@iapicca
Copy link

iapicca commented Nov 29, 2019

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

Could everyone who still has this problem please file a new issue with the exact descriptions what happens, logs and the output of 'flutter doctor -v' please.
All system setups can be slightly different so its always better to open new issues and reference related issues.

@iapicca iapicca closed this as completed Nov 29, 2019
@firebase firebase locked and limited conversation to collaborators Aug 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants