Example using ReadN

I'm trying to create a tcp protocol for my game using gnet. I put it under stress and received an incomplete message. The http example comes pretty close to my use case and does handle incomplete messages, but it's pretty complicated.
There is a large comment about the function ReadN that describes what it might be used for but not how. When should I use Read and when should I use ReadN? An example using ReadN as intended would help a great deal.

@ezmicken
You invoke Read(), you get all data from the inbound buffer that might contain incomplete data from the last few requests and current request, besides it doesn't evict those data from the buffer, you have to invoke ResetBuffer() at the end of the React if you ensure that you've gotten the expected data from Read() while ReadN(n int)  gives you bytes with the given fixed length and it does evict those data from the buffer, hence you should use this function only if you know exactly the length of subsequent TCP stream based on the protocol, like the Content-Length attribute in an HTTP request which indicates you how much data you should read from inbound ring-buffer.
In fact, ReadN() could be replaced with the FixedLengthFrameCodec which is one of the codecs of gnet with which you are able to make it easier to unpack and pack frames based on your protocol and you can find the examples in my example or test code.
Thank you for your attention to gnet and please let me know if you still have any questions later.

Thanks, that's what I was looking for and I think I understand now.

I am closing this issue but feel free to open a new issue if you get new questions later.


🐛 [CLOUD_FIRESTORE] Unhandled Exception when using get() offline with default options on a non-existing document

Bug report
Describe the bug
I was testing an iOS app offline on the simulator, and I received the following error when performing a get() operation with the default option (Source.serverAndCache):
[VERBOSE-2:shell.cc(210)] Unhandled Exception:: [cloud_firestore/unavailable] The service is currently unavailable.
This is a most likely a transient condition and may be corrected by retrying with a backoff.,
stack trace: #0      MethodChannelDocumentReference.get
package:cloud_firestore_platform_interface/…/method_channel/method_channel_document_reference.dart:80
<asynchronous suspension>
#1      DocumentReference.get
package:cloud_firestore/src/document_reference.dart:63
// # 2,3,4,5 trace to my functions
#6      _RootZone.runUnary (dart:async/zone.dart:1450:54)
#7      _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#8 <…>

Steps to reproduce
When offline, the following throws an error
final firestore = FirebaseFirestore.instance;
final snapshot = await firestore.doc(path).get();  //  ❌ exception
// or
final snapshot = await firestore.doc(path).get(GetOptions(source: Source.serverAndCache));  // ❌  also exception

When the source  is changed to cache only, the data is retrieved fine without an error:
final snapshot = await firestore.doc(path).get(GetOptions(source: Source.cache));  // ✅ works

Expected behavior
Source.serverAndCache behavior should be the same as Source.cache when offline.

Flutter doctor
Run flutter doctor and paste the output below:
Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.6 19G2021 darwin-x64, locale en)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.52.1)
[✓] Connected device (1 available)

• No issues found!

Flutter dependencies
Run flutter pub deps -- --style=compact and paste the output below:
Click To Expand
Dart SDK 2.10.4
Flutter SDK 1.22.5

dependencies:
- cached_network_image 2.3.3 [flutter flutter_cache_manager octo_image]
- cloud_firestore 0.14.4 [flutter meta quiver firebase_core firebase_core_platform_interface cloud_firestore_platform_interface cloud_firestore_web]
- cloud_functions 0.7.2 [meta flutter firebase_core firebase_core_platform_interface cloud_functions_platform_interface cloud_functions_web]
- country_list_pick 1.0.1+2 [flutter]
- cupertino_icons 1.0.0
- file_picker 2.0.7 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface]
- firebase_analytics 6.0.2 [meta flutter firebase_core firebase_analytics_web firebase_analytics_platform_interface]
- firebase_auth 0.18.4+1 [meta firebase_core firebase_core_platform_interface firebase_auth_platform_interface firebase_auth_web flutter]
- firebase_core 0.5.3 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
- firebase_storage 4.0.1 [flutter firebase_core]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- image_cropper 1.3.1 [flutter]
- image_picker 0.6.7+11 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface]
- language_pickers 0.2.0+1 [flutter]
- provider 4.3.2+2 [flutter nested collection]
- sembast_sqflite 1.0.0 [sembast sqflite_common meta]
- shared_preferences 0.5.12 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows]
- sqflite 1.3.2+1 [flutter sqflite_common path]
- zefyr 0.11.0 [flutter collection url_launcher quill_delta notus meta quiver_hashcode]

dev dependencies:
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]

transitive dependencies:
- async 2.5.0-nullsafety.1 [collection]
- boolean_selector 2.1.0-nullsafety.1 [source_span string_scanner]
- characters 1.1.0-nullsafety.3
- charcode 1.2.0-nullsafety.1
- clock 1.1.0-nullsafety.1
- cloud_firestore_platform_interface 2.2.1 [flutter meta collection firebase_core plugin_platform_interface]
- cloud_firestore_web 0.2.1+2 [flutter flutter_web_plugins http_parser meta firebase_core firebase_core_web cloud_firestore_platform_interface js]
- cloud_functions_platform_interface 3.0.3 [flutter meta firebase_core plugin_platform_interface]
- cloud_functions_web 3.1.1 [firebase_core firebase_core_web cloud_functions_platform_interface flutter flutter_web_plugins http_parser meta js]
- collection 1.15.0-nullsafety.3
- convert 2.1.1 [charcode typed_data]
- crypto 2.1.5 [collection convert typed_data]
- fake_async 1.2.0-nullsafety.1 [clock collection]
- ffi 0.1.3
- file 5.2.1 [intl meta path]
- firebase 7.3.0 [http http_parser js]
- firebase_analytics_platform_interface 1.0.3 [flutter meta]
- firebase_analytics_web 0.1.1 [flutter flutter_web_plugins firebase firebase_analytics_platform_interface meta]
- firebase_auth_platform_interface 2.1.4 [flutter meta firebase_core plugin_platform_interface]
- firebase_auth_web 0.3.2+3 [flutter flutter_web_plugins meta http_parser intl firebase_core firebase_core_web firebase_auth_platform_interface js]
- firebase_core_platform_interface 2.1.0 [flutter meta plugin_platform_interface quiver]
- firebase_core_web 0.2.1+1 [firebase_core_platform_interface flutter flutter_web_plugins meta js]
- flex_color_picker 1.1.2 [flutter]
- flutter_blurhash 0.5.0 [flutter meta]
- flutter_cache_manager 1.4.2 [flutter path_provider uuid http path sqflite pedantic clock file rxdart]
- flutter_circle_color_picker 0.2.0 [flutter]
- flutter_plugin_android_lifecycle 1.0.11 [flutter]
- flutter_svg 0.19.0 [path_drawing xml vector_math meta flutter]
- flutter_web_plugins 0.0.0 [flutter characters collection meta typed_data vector_math]
- http 0.12.2 [http_parser path pedantic]
- http_parser 3.1.4 [charcode collection source_span string_scanner typed_data]
- image_picker_platform_interface 1.1.1 [flutter meta http plugin_platform_interface]
- intl 0.16.1 [path]
- js 0.6.2
- matcher 0.12.10-nullsafety.1 [stack_trace]
- matrix_gesture_detector 0.1.0 [flutter vector_math]
- meta 1.3.0-nullsafety.3
- nested 0.0.4 [flutter]
- notus 0.1.5 [collection meta quill_delta quiver_hashcode]
- octo_image 0.3.0 [flutter flutter_blurhash]
- path 1.8.0-nullsafety.1
- path_drawing 0.4.1+1 [vector_math meta path_parsing flutter]
- path_parsing 0.1.4 [vector_math meta]
- path_provider 1.6.18 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows]
- path_provider_linux 0.0.1+2 [path xdg_directories path_provider_platform_interface flutter]
- path_provider_macos 0.0.4+4 [flutter]
- path_provider_platform_interface 1.0.3 [flutter meta platform plugin_platform_interface]
- path_provider_windows 0.0.4+1 [path_provider_platform_interface meta path flutter ffi win32]
- pedantic 1.9.2 [meta]
- petitparser 3.1.0 [meta]
- platform 2.2.1
- plugin_platform_interface 1.0.3 [meta]
- process 3.0.13 [file intl meta path platform]
- quill_delta 1.1.3 [collection quiver_hashcode]
- quiver 2.1.3 [matcher meta]
- quiver_hashcode 2.0.0
- rxdart 0.24.1
- sembast 2.4.8+1 [meta path synchronized]
- shared_preferences_linux 0.0.2+2 [file flutter meta path path_provider_linux shared_preferences_platform_interface]
- shared_preferences_macos 0.0.1+10 [shared_preferences_platform_interface flutter]
- shared_preferences_platform_interface 1.0.4 [meta flutter]
- shared_preferences_web 0.1.2+7 [shared_preferences_platform_interface flutter flutter_web_plugins meta]
- shared_preferences_windows 0.0.1+1 [shared_preferences_platform_interface flutter ffi file meta path path_provider_platform_interface path_provider_windows]
- sky_engine 0.0.99
- source_span 1.8.0-nullsafety.2 [charcode collection path term_glyph]
- sqflite_common 1.0.2+1 [synchronized path meta]
- stack_trace 1.10.0-nullsafety.1 [path]
- stream_channel 2.1.0-nullsafety.1 [async]
- string_scanner 1.1.0-nullsafety.1 [charcode source_span]
- synchronized 2.2.0+2
- term_glyph 1.2.0-nullsafety.1
- test_api 0.2.19-nullsafety.2 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- tuple 1.0.3 [quiver]
- typed_data 1.3.0-nullsafety.3 [collection]
- undo 1.3.0+1
- url_launcher 5.7.2 [flutter url_launcher_platform_interface url_launcher_web url_launcher_linux url_launcher_macos url_launcher_windows]
- url_launcher_linux 0.0.1+1 [flutter]
- url_launcher_macos 0.0.1+8 [flutter]
- url_launcher_platform_interface 1.0.8 [flutter meta plugin_platform_interface]
- url_launcher_web 0.1.4+1 [url_launcher_platform_interface flutter flutter_web_plugins meta]
- url_launcher_windows 0.0.1+1 [flutter]
- uuid 2.2.2 [crypto convert]
- vector_math 2.1.0-nullsafety.3
- win32 1.7.3 [ffi]
- xdg_directories 0.1.2 [meta path process]
- xml 4.5.1 [collection convert meta petitparser]

Hi @osaxma
Have you run into this on a physical device as well?
Thank you

Hi @osaxma
Have you run into this on a physical device as well?
Thank you

Hi @markusaksli-nc
I just tested in a real device. The same error message and same behavior:

The error only occurs with the get() method (streams are fine).
While offline, changing the code to get(GetOptions(source: Source.cache)) retrieves the results immediately with hot reload.

Unhandled Exception: [cloud_firestore/unavailable] The service is currently unavailable.
This is a most likely a transient condition and may be corrected by retrying with a backoff.
#0      MethodChannelDocumentReference.get
package:cloud_firestore_platform_interface/…/method_channel/method_channel_document_reference.dart:80
<asynchronous suspension>
#1      DocumentReference.get
package:cloud_firestore/src/document_reference.dart:63
// #2,3 trace to my function
<asynchronous suspension>

Hi @markusaksli-nc
I just tested in a real device. The same error message and same behavior:

The error only occurs with the get() method (streams are fine).
While offline, changing the code to get(GetOptions(source: Source.cache)) retrieves the results immediately with hot reload.

Unhandled Exception: [cloud_firestore/unavailable] The service is currently unavailable.
This is a most likely a transient condition and may be corrected by retrying with a backoff.
#0      MethodChannelDocumentReference.get
package:cloud_firestore_platform_interface/…/method_channel/method_channel_document_reference.dart:80
<asynchronous suspension>
#1      DocumentReference.get
package:cloud_firestore/src/document_reference.dart:63
// #2,3 trace to my function
<asynchronous suspension>

I was not able to reproduce this on the latest master 1.26.0-2.0.pre.275 with cloud_firestore: ^0.14.4.

flutter doctor -v
[✓] Flutter (Channel master, 1.26.0-2.0.pre.275, on macOS 11.1 20C69 darwin-arm, locale en-GB)
    • Flutter version 1.26.0-2.0.pre.275 at /Users/nevercode/development/flutter_master
    • Framework revision d9044a8a61 (2 days ago), 2021-01-09 04:04:04 -0500
    • Engine revision caf6a8191f
    • Dart version 2.12.0 (build 2.12.0-204.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/nevercode/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Users/nevercode/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.6953283/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Users/nevercode/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.6953283/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      � https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      � https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] Connected device (4 available)
    • Nevercode’s iPhone (mobile) • b668e524315069f3db3661ac11ff1f66afafebdb • ios            • iOS 14.3
    • iPhone 12 Pro Max (mobile)  • 09D9E93F-A98D-4735-B6E6-6E57F9CD01D8     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)             • macos                                    • darwin-arm64   • macOS 11.1 20C69 darwin-arm
    • Chrome (web)                • chrome                                   • web-javascript • Google Chrome 87.0.4280.141

• No issues found!

Complete code sample
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';

const String doc = 'test/geo';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  FirebaseApp app = await Firebase.initializeApp();
  assert(app != null);
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Material App',
      theme: ThemeData.dark(),
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Firestore Example'),
      ),
      body: Center(
        child: Column(
          children: [
            ElevatedButton(
              child: const Text("Get default"),
              onPressed: () async {
                print((await FirebaseFirestore.instance.doc(doc).get()).data());
              },
            ),
            ElevatedButton(
              child: const Text("Get serverAndCache"),
              onPressed: () async {
                print((await FirebaseFirestore.instance.doc(doc).get(GetOptions(source: Source.serverAndCache))).data());
              },
            ),
            ElevatedButton(
              child: const Text("Get server"),
              onPressed: () async {
                print((await FirebaseFirestore.instance.doc(doc).get(GetOptions(source: Source.server))).data());
              },
            ),
            ElevatedButton(
              child: const Text("Get cached"),
              onPressed: () async {
                print((await FirebaseFirestore.instance.doc(doc).get(GetOptions(source: Source.cache))).data());
              },
            ),
          ],
        ),
      ),
    );
  }
}

When the data is cached it will retrieve it with default as expected.
Are you able to reproduce the issue with this code?

I was not able to reproduce this on the latest master 1.26.0-2.0.pre.275 with cloud_firestore: ^0.14.4.

flutter doctor -v
[✓] Flutter (Channel master, 1.26.0-2.0.pre.275, on macOS 11.1 20C69 darwin-arm, locale en-GB)
    • Flutter version 1.26.0-2.0.pre.275 at /Users/nevercode/development/flutter_master
    • Framework revision d9044a8a61 (2 days ago), 2021-01-09 04:04:04 -0500
    • Engine revision caf6a8191f
    • Dart version 2.12.0 (build 2.12.0-204.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/nevercode/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Users/nevercode/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.6953283/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Users/nevercode/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.6953283/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      � https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      � https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] Connected device (4 available)
    • Nevercode’s iPhone (mobile) • b668e524315069f3db3661ac11ff1f66afafebdb • ios            • iOS 14.3
    • iPhone 12 Pro Max (mobile)  • 09D9E93F-A98D-4735-B6E6-6E57F9CD01D8     • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)             • macos                                    • darwin-arm64   • macOS 11.1 20C69 darwin-arm
    • Chrome (web)                • chrome                                   • web-javascript • Google Chrome 87.0.4280.141

• No issues found!

Complete code sample
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';

const String doc = 'test/geo';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  FirebaseApp app = await Firebase.initializeApp();
  assert(app != null);
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Material App',
      theme: ThemeData.dark(),
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Firestore Example'),
      ),
      body: Center(
        child: Column(
          children: [
            ElevatedButton(
              child: const Text("Get default"),
              onPressed: () async {
                print((await FirebaseFirestore.instance.doc(doc).get()).data());
              },
            ),
            ElevatedButton(
              child: const Text("Get serverAndCache"),
              onPressed: () async {
                print((await FirebaseFirestore.instance.doc(doc).get(GetOptions(source: Source.serverAndCache))).data());
              },
            ),
            ElevatedButton(
              child: const Text("Get server"),
              onPressed: () async {
                print((await FirebaseFirestore.instance.doc(doc).get(GetOptions(source: Source.server))).data());
              },
            ),
            ElevatedButton(
              child: const Text("Get cached"),
              onPressed: () async {
                print((await FirebaseFirestore.instance.doc(doc).get(GetOptions(source: Source.cache))).data());
              },
            ),
          ],
        ),
      ),
    );
  }
}

When the data is cached it will retrieve it with default as expected.
Are you able to reproduce the issue with this code?

I guess I found the root cause after some digging.
In short, the error occurs when:

The device is offline
Using get() with the default Source.serverAndCache
The is reference for a non-existing document.

To demonstrate, this code throws an error when offline:
using flutter master 1.26.0-2.0.pre.275 and cloud_firestore: ^0.14.4
    final firestore =  FirebaseFirestore.instance;
    final getOptions = GetOptions(source: Source.serverAndCache);
    // this will work fine
    final existingDocument = await firestore.doc("collection/existingDocument").get(getOptions);
    // this will throw an error
    final nonExistingDocument = await firestore.doc("collection/nonExistingDocument").get(getOptions);

For the same code above and while offline, changing the source to Source.cache does not throw an error. And calling nonExistingDocument.exists returns false as expected.
Exception Message
[VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: [cloud_firestore/unavailable] The service is currently unavailable.
This is a most likely a transient condition and may be corrected by retrying with a backoff.
#0      MethodChannelDocumentReference.get
package:cloud_firestore_platform_interface/…/method_channel/method_channel_document_reference.dart:80
<asynchronous suspension>
#1      DocumentReference.get
package:cloud_firestore/src/document_reference.dart:63

@markusaksli-nc Please let me know if you need any additional information.

I guess I found the root cause after some digging.
In short, the error occurs when:

The device is offline
Using get() with the default Source.serverAndCache
The is reference for a non-existing document.

To demonstrate, this code throws an error when offline:
using flutter master 1.26.0-2.0.pre.275 and cloud_firestore: ^0.14.4
    final firestore =  FirebaseFirestore.instance;
    final getOptions = GetOptions(source: Source.serverAndCache);
    // this will work fine
    final existingDocument = await firestore.doc("collection/existingDocument").get(getOptions);
    // this will throw an error
    final nonExistingDocument = await firestore.doc("collection/nonExistingDocument").get(getOptions);

For the same code above and while offline, changing the source to Source.cache does not throw an error. And calling nonExistingDocument.exists returns false as expected.
Exception Message
[VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: [cloud_firestore/unavailable] The service is currently unavailable.
This is a most likely a transient condition and may be corrected by retrying with a backoff.
#0      MethodChannelDocumentReference.get
package:cloud_firestore_platform_interface/…/method_channel/method_channel_document_reference.dart:80
<asynchronous suspension>
#1      DocumentReference.get
package:cloud_firestore/src/document_reference.dart:63

@markusaksli-nc Please let me know if you need any additional information.

I was able to reproduce this on the latest master 1.26.0-2.0.pre.313 with
firebase_core: ^0.7.0
cloud_firestore: ^0.16.0

flutter doctor -v
[√] Flutter (Channel master, 1.26.0-2.0.pre.313, on Microsoft Windows [Version 10.0.19041.685], locale et-EE)
    • Flutter version 1.26.0-2.0.pre.313 at C:\Development\flutter_master
    • Framework revision 1cb0a24a46 (6 hours ago), 2021-01-12 21:39:27 -0800
    • Engine revision 10cee6abcb
    • Dart version 2.12.0 (build 2.12.0-214.0.dev)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\marku\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: C:\Users\marku\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.6953283\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.7)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.7.30621.155
    • Windows 10 SDK version 10.0.18362.0

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Users\marku\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.6953283
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] Connected device (4 available)
    • SM G950F (mobile) • ce12171c51cc001c03 • android-arm64  • Android 9 (API 28)
    • Windows (desktop) • windows            • windows-x64    • Microsoft Windows [Version 10.0.19041.685]
    • Chrome (web)      • chrome             • web-javascript • Google Chrome 87.0.4280.141
    • Edge (web)        • edge               • web-javascript • Microsoft Edge 87.0.664.66

• No issues found!

Minimal reproducible code sample
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';

const String existingDoc = 'test/geo';
const String nonExistingDoc = 'test/ababab';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  FirebaseApp app = await Firebase.initializeApp();
  assert(app != null);
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Material App',
      theme: ThemeData.dark(),
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Firestore Example'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            ElevatedButton(
              child: const Text("Get serverAndCache (existing)"),
              onPressed: () async {
                var doc = await FirebaseFirestore.instance.doc(existingDoc).get(GetOptions(source: Source.serverAndCache));
                print(doc.exists);
                print(doc.data());
              },
            ),
            ElevatedButton(
              child: const Text("Get serverAndCache (non existing)"),
              onPressed: () async {
                var doc = await FirebaseFirestore.instance.doc(nonExistingDoc).get(GetOptions(source: Source.serverAndCache));
                print(doc.exists);
                print(doc.data());
              },
            ),
            ElevatedButton(
              child: const Text("Get cache (existing)"),
              onPressed: () async {
                var doc = await FirebaseFirestore.instance.doc(existingDoc).get(GetOptions(source: Source.cache));
                print(doc.exists);
                print(doc.data());
              },
            ),
            ElevatedButton(
              child: const Text("Get cache (non existing)"),
              onPressed: () async {
                var doc = await FirebaseFirestore.instance.doc(nonExistingDoc).get(GetOptions(source: Source.cache));
                print(doc.exists);
                print(doc.data());
              },
            ),
          ],
        ),
      ),
    );
  }
}

Logs (non existing doc default offline get)
D/ViewRootImpl@b1c840b[MainActivity](19937): ViewPostIme pointer 0
D/ViewRootImpl@b1c840b[MainActivity](19937): ViewPostIme pointer 1
W/Firestore(19937): (22.0.1) [WatchStream]: (7b78670) Stream closed with status: Status{code=UNAVAILABLE, description=Unable to resolve host firestore.googleapis.com, cause=java.lang.RuntimeException: java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver.resolveAll(DnsNameResolver.java:436)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver$Resolve.resolveInternal(DnsNameResolver.java:272)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:228)
W/Firestore(19937): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/Firestore(19937): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/Firestore(19937): 	at java.lang.Thread.run(Thread.java:764)
W/Firestore(19937): Caused by: java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
W/Firestore(19937): 	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:157)
W/Firestore(19937): 	at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:105)
W/Firestore(19937): 	at java.net.InetAddress.getAllByName(InetAddress.java:1154)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver$JdkAddressResolver.resolveAddress(DnsNameResolver.java:646)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver.resolveAll(DnsNameResolver.java:404)
W/Firestore(19937): 	... 5 more
W/Firestore(19937): Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
W/Firestore(19937): 	at libcore.io.Linux.android_getaddrinfo(Native Method)
W/Firestore(19937): 	at libcore.io.BlockGuardOs.android_getaddrinfo(BlockGuardOs.java:172)
W/Firestore(19937): 	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:137)
W/Firestore(19937): 	... 9 more
W/Firestore(19937): }.
E/flutter (19937): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: [cloud_firestore/unavailable] The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.
E/flutter (19937): #0      MethodChannelDocumentReference.get (package:cloud_firestore_platform_interface/src/method_channel/method_channel_document_reference.dart:80:7)
E/flutter (19937): <asynchronous suspension>
E/flutter (19937): #1      DocumentReference.get (package:cloud_firestore/src/document_reference.dart:59:20)
E/flutter (19937): <asynchronous suspension>
E/flutter (19937): #2      Home.build.<anonymous closure> (package:triage/main.dart:50:27)
E/flutter (19937): <asynchronous suspension>
E/flutter (19937):
W/Firestore(19937): (22.0.1) [WatchStream]: (7b78670) Stream closed with status: Status{code=UNAVAILABLE, description=Unable to resolve host firestore.googleapis.com, cause=java.lang.RuntimeException: java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver.resolveAll(DnsNameResolver.java:436)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver$Resolve.resolveInternal(DnsNameResolver.java:272)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:228)
W/Firestore(19937): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/Firestore(19937): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/Firestore(19937): 	at java.lang.Thread.run(Thread.java:764)
W/Firestore(19937): Caused by: java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
W/Firestore(19937): 	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:157)
W/Firestore(19937): 	at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:105)
W/Firestore(19937): 	at java.net.InetAddress.getAllByName(InetAddress.java:1154)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver$JdkAddressResolver.resolveAddress(DnsNameResolver.java:646)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver.resolveAll(DnsNameResolver.java:404)
W/Firestore(19937): 	... 5 more
W/Firestore(19937): Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
W/Firestore(19937): 	at libcore.io.Linux.android_getaddrinfo(Native Method)
W/Firestore(19937): 	at libcore.io.BlockGuardOs.android_getaddrinfo(BlockGuardOs.java:172)
W/Firestore(19937): 	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:137)
W/Firestore(19937): 	... 9 more
W/Firestore(19937): }.

Logs (existing doc cached offline get)
D/ViewRootImpl@b1c840b[MainActivity](19937): ViewPostIme pointer 0
D/ViewRootImpl@b1c840b[MainActivity](19937): ViewPostIme pointer 1
I/flutter (19937): false
I/flutter (19937): null

I was able to reproduce this on the latest master 1.26.0-2.0.pre.313 with
firebase_core: ^0.7.0
cloud_firestore: ^0.16.0

flutter doctor -v
[√] Flutter (Channel master, 1.26.0-2.0.pre.313, on Microsoft Windows [Version 10.0.19041.685], locale et-EE)
    • Flutter version 1.26.0-2.0.pre.313 at C:\Development\flutter_master
    • Framework revision 1cb0a24a46 (6 hours ago), 2021-01-12 21:39:27 -0800
    • Engine revision 10cee6abcb
    • Dart version 2.12.0 (build 2.12.0-214.0.dev)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\marku\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: C:\Users\marku\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.6953283\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.7)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.7.30621.155
    • Windows 10 SDK version 10.0.18362.0

[√] Android Studio (version 4.1.0)
    • Android Studio at C:\Users\marku\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.6953283
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] Connected device (4 available)
    • SM G950F (mobile) • ce12171c51cc001c03 • android-arm64  • Android 9 (API 28)
    • Windows (desktop) • windows            • windows-x64    • Microsoft Windows [Version 10.0.19041.685]
    • Chrome (web)      • chrome             • web-javascript • Google Chrome 87.0.4280.141
    • Edge (web)        • edge               • web-javascript • Microsoft Edge 87.0.664.66

• No issues found!

Minimal reproducible code sample
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';

const String existingDoc = 'test/geo';
const String nonExistingDoc = 'test/ababab';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  FirebaseApp app = await Firebase.initializeApp();
  assert(app != null);
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Material App',
      theme: ThemeData.dark(),
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Firestore Example'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: [
            ElevatedButton(
              child: const Text("Get serverAndCache (existing)"),
              onPressed: () async {
                var doc = await FirebaseFirestore.instance.doc(existingDoc).get(GetOptions(source: Source.serverAndCache));
                print(doc.exists);
                print(doc.data());
              },
            ),
            ElevatedButton(
              child: const Text("Get serverAndCache (non existing)"),
              onPressed: () async {
                var doc = await FirebaseFirestore.instance.doc(nonExistingDoc).get(GetOptions(source: Source.serverAndCache));
                print(doc.exists);
                print(doc.data());
              },
            ),
            ElevatedButton(
              child: const Text("Get cache (existing)"),
              onPressed: () async {
                var doc = await FirebaseFirestore.instance.doc(existingDoc).get(GetOptions(source: Source.cache));
                print(doc.exists);
                print(doc.data());
              },
            ),
            ElevatedButton(
              child: const Text("Get cache (non existing)"),
              onPressed: () async {
                var doc = await FirebaseFirestore.instance.doc(nonExistingDoc).get(GetOptions(source: Source.cache));
                print(doc.exists);
                print(doc.data());
              },
            ),
          ],
        ),
      ),
    );
  }
}

Logs (non existing doc default offline get)
D/ViewRootImpl@b1c840b[MainActivity](19937): ViewPostIme pointer 0
D/ViewRootImpl@b1c840b[MainActivity](19937): ViewPostIme pointer 1
W/Firestore(19937): (22.0.1) [WatchStream]: (7b78670) Stream closed with status: Status{code=UNAVAILABLE, description=Unable to resolve host firestore.googleapis.com, cause=java.lang.RuntimeException: java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver.resolveAll(DnsNameResolver.java:436)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver$Resolve.resolveInternal(DnsNameResolver.java:272)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:228)
W/Firestore(19937): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/Firestore(19937): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/Firestore(19937): 	at java.lang.Thread.run(Thread.java:764)
W/Firestore(19937): Caused by: java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
W/Firestore(19937): 	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:157)
W/Firestore(19937): 	at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:105)
W/Firestore(19937): 	at java.net.InetAddress.getAllByName(InetAddress.java:1154)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver$JdkAddressResolver.resolveAddress(DnsNameResolver.java:646)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver.resolveAll(DnsNameResolver.java:404)
W/Firestore(19937): 	... 5 more
W/Firestore(19937): Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
W/Firestore(19937): 	at libcore.io.Linux.android_getaddrinfo(Native Method)
W/Firestore(19937): 	at libcore.io.BlockGuardOs.android_getaddrinfo(BlockGuardOs.java:172)
W/Firestore(19937): 	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:137)
W/Firestore(19937): 	... 9 more
W/Firestore(19937): }.
E/flutter (19937): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: [cloud_firestore/unavailable] The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.
E/flutter (19937): #0      MethodChannelDocumentReference.get (package:cloud_firestore_platform_interface/src/method_channel/method_channel_document_reference.dart:80:7)
E/flutter (19937): <asynchronous suspension>
E/flutter (19937): #1      DocumentReference.get (package:cloud_firestore/src/document_reference.dart:59:20)
E/flutter (19937): <asynchronous suspension>
E/flutter (19937): #2      Home.build.<anonymous closure> (package:triage/main.dart:50:27)
E/flutter (19937): <asynchronous suspension>
E/flutter (19937):
W/Firestore(19937): (22.0.1) [WatchStream]: (7b78670) Stream closed with status: Status{code=UNAVAILABLE, description=Unable to resolve host firestore.googleapis.com, cause=java.lang.RuntimeException: java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver.resolveAll(DnsNameResolver.java:436)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver$Resolve.resolveInternal(DnsNameResolver.java:272)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:228)
W/Firestore(19937): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/Firestore(19937): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/Firestore(19937): 	at java.lang.Thread.run(Thread.java:764)
W/Firestore(19937): Caused by: java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
W/Firestore(19937): 	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:157)
W/Firestore(19937): 	at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:105)
W/Firestore(19937): 	at java.net.InetAddress.getAllByName(InetAddress.java:1154)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver$JdkAddressResolver.resolveAddress(DnsNameResolver.java:646)
W/Firestore(19937): 	at io.grpc.internal.DnsNameResolver.resolveAll(DnsNameResolver.java:404)
W/Firestore(19937): 	... 5 more
W/Firestore(19937): Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
W/Firestore(19937): 	at libcore.io.Linux.android_getaddrinfo(Native Method)
W/Firestore(19937): 	at libcore.io.BlockGuardOs.android_getaddrinfo(BlockGuardOs.java:172)
W/Firestore(19937): 	at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:137)
W/Firestore(19937): 	... 9 more
W/Firestore(19937): }.

Logs (existing doc cached offline get)
D/ViewRootImpl@b1c840b[MainActivity](19937): ViewPostIme pointer 0
D/ViewRootImpl@b1c840b[MainActivity](19937): ViewPostIme pointer 1
I/flutter (19937): false
I/flutter (19937): null

Hey @osaxma, this is expected behaviour I'm afraid.  The underlying android or iOS sdk is trying to make a network request which is causing the cloud_firestore/unavailable error because the device is offline. When you set the cache option, it doesn't make a network request which is why there is no error. This is not something we have much control over as we're simply relaying the error from native back to user implementation.

As mentioned, this is expected behaviour so I'm going to close this issue.


Format codebase with mix format

Coverage decreased (-0.0008%) to 99.715% when pulling 16e53d58adfcedbf286df984e70d48cb749e4417 on jfornoff:formatter into 7c6186ba8a90d9406d2b79351081373a52baffdf on shinyscorpion:master.


[Feature] Resume sweeps

Is your feature request related to a problem? Please describe.
In the documentation on resuming runs, there is a note that says:
Note that resuming a run which was executed as part of a Sweep is not supported.
I often want to resume runs that I executed during a sweep -- for example, to train for longer if they haven't finished converging.
Describe the solution you'd like
I'd love if resuming sweeps was supported!
Describe alternatives you've considered
The alternatives I see are all undesirable -- loading the run from a saved checkpoint and training in a new run (loses connection to all the old plots), or training from scratch with more epochs (waste of time and compute).

Thanks!

@dannygoldstein I've noticed that this feature is live, and have tried it. I'm struggling to make it work: I keep getting errors which tell me that the id is set, and that the previous run cannot be resumed.
wandb: WARNING Tried to auto resume run with id foo but id bar is set.
I'm trying to use this on a machine with timeouts (slurm based).
I've added      wandb.init(         config=args,         resume=True,     )
to my script. This seems to be the only required change in the documentation. https://docs.wandb.ai/guides/track/advanced/resuming

resume=True will only work if you resume experiments from the same file system.  If you want to resume from a different machine with a different file system you'll need to pass an id.
The error you're getting could be from setting an id in the environment.  Can you check if WANDB_RUN_ID is set in your environment?

The file system is the same. Afaict, the environment is not setting WANDB_RUN_ID.
My understanding of the feature is that the sweep would re-queue the run id if it failed (using wandb.mark_preempting), ie set WANDB_RUN_ID to the previously interrupted run, and then the run would be resumed at the next call to wandb agent.

A bit more info:

Run A is started by the sweep. Then, it gets a SIGTERM signal, which I use to trigger wandb.mark_preemptive.
I call wandb agent ... again. Although the previous run is marked as preemptive, the agent sets a new run id B. That's where I get the warning. WARNING Tried to auto resume run with id A but id B is set..

hi @GeoffNN, this is not actually the feature I was talking about, we have another one coming out soon called rewind (has been delayed a bit) that should make addressing this issue easier.
the one you have found, preemptible sweeps, is where mark_preempting() comes from.
wandb.mark_preempting() will mark a run preempting, but the run is not requeued until the status is preempted. the status change happens when the run exits with status (maybe your signal handler is preventing this) or after the run spends 5 minutes in the preempting state and our backend receives no heartbeats from the run.
if the run exits successfully (with zero status) after being put into the preempting state we assume the run finished successfully before being preempted by the server and the run state is set to finished. in this case the run will not be requeued.

@GeoffNN their are likely 2 ways to fix this:

call wandb.finish(exit_code=1) after you mark the run as prempting
Make your process exit with a non-zero status, exit(1)

Oh, interesting. Thanks for your in-depth answer @dannygoldstein!
@vanpelt, thank you as well, that should fix it!

Thanks for the info on wandb.mark_preempting()!
However, I still want to resume a run / sweep that has finished successfully, to train it for logger. Is this possible? I see https://github.com/wandb/client/issues/1787 but that's not what I have in mind (deleting the run is not a solution since it takes a long time to train).
@dannygoldstein was there another feature you're working on that would support re-running the sweep and continuing the runs where they left off after, say, updating the YAML config? Thanks!

Collin

Hi, having similar use case. Would it be possible to change the state of a run with the python API to preempted so it can be resumed? I have tried to do so with:
run = wandb.Api().run('run-id')
run._state = 'preempted'
run.update()

Which did not throw any error, but also did not update the state in the UI.


catchplay

XstreamDL-2022-03-25_001455.log
Hello, how should I download subtitles from this link?
https://www.catchplay.com/tw/watch/5bdaf363-34b2-4095-afd5-2609dbc2b968

it looks encrypted

I got the key, how do I get the subtitles? thanks

I got the video and audio, but I can't download the subtitles.

All platform URL is description page (detail page), not watch page.


Fix intermittent broken pipe issue in log

This commit fixes #4713, by adopting the suggested fix in:
https://github.com/go-sql-driver/mysql/issues/529
I have verified this on the longevity test environment, we can keep this in master as long as we don't see impact in 1.5 release.

Coverage increased (+0.06%) to 64.49% when pulling 7fa82616612f60b3122778eaecdcb1b35f802477 on reasonerjt:fix-db-broken-pipe into<PHONE_NUMBER>09d566c2c5eea77d00448fb55a8c8d on vmware:master.


Use of the coordinates attribute to reference geometry coordinates from an index.

I think we should avoid the use of coordinates to point from the multi-polygon index (coordinate indices and hole/multipolygon indicators). coordinates is typically used to reference variables defined on the same dimension(s). The variables referenced contain spatial or temporal information for THAT dimension. In our case, they are coordinates, but the relationship between the index variable and the coordinates is a bit different. I think calling it geom_coordinates would be better. This is in line with the geom_type attribute and is general enough to be used with lines and polygons.

Good point. This makes sense to me. :+1:

Changed attribute name in the constants file.


[CI][Packaging][Python] Simplify dev/tasks/python-wheels/github.linux.yml

Describe the enhancement requested
This is a follow-up task of #45040.
We can simplify the #45040 implementation by using GitHub Actions' standard features.
See also: https://github.com/apache/arrow/pull/45040#discussion_r1889203170
Component(s)
Continuous Integration, Packaging, Python

Issue resolved by pull request 45077
https://github.com/apache/arrow/pull/45077


[New Animation] - specials/stamp

I made a small animation, the purpose of this animation is to create the action like stamping.
Preview: https://codepen.io/JayCeS/pen/yQyZzL

@eltonmesquita I think we can add this one... what do you think @daneden ?

@eltonmesquita @daneden lets add this one on v4

Thanks for the PR @jcs090218 !
I think this one's a bit over and the motion feels unnatural. I don't know how this would fit in an interface.
Any opinion on this @daneden ?

Agreed, this feels pretty use-case specific and has some issues—scaling an element so large causes pixelation that we’d want to avoid.

thanks guys for the review @daneden @eltonmesquita


WIP: Feature downloaddemo simplification

Requires other PRs to be finished first. PR already created to test new CI actions.

Closed since not the final version of this branch, was just for github action testing. Thought of a better way for that. Will reopen a new one when branch ready.


Is Electron supported?

Describe the bug
The basic functionality seems not working in Electron. It does not even show the cropping frame. I used the following simple code.
import React, { useState } from 'react';
import Cropper from 'react-cropper';
import 'cropperjs/dist/cropper.css';

const ImageCrop = () => {
  const [upImg, setUpImg] = useState();

  const onSelectFile = e => {
    if (e.target.files && e.target.files.length > 0) {
      const reader = new FileReader();
      reader.addEventListener('load', () => setUpImg(reader.result));
      reader.readAsDataURL(e.target.files[0]);
    }
  };

  return (
    <>
      <div>
        <input type="file" accept="image/*" onChange={onSelectFile} />
      </div>
      <Cropper src={upImg} />
    </>
  );
};

export default ImageCrop;

Screenshots

Desktop (please complete the following information):

OS: [macOS]
Browser [elecron]
Version [11.0.1]

me too~ doesnt work at all in electron based app

please open this issue ,I m unable to use cropper in electron.

@virinchi-manepalli-trysolvio Try manually importing the css, that fixed it for me.
https://stackoverflow.com/questions/67030246/cropping-js-libraries-do-not-work-in-election/68752693#68752693


click integration - provide options that translate into a context value

currently the click integration cannot pass options into the context easily
i'd like to be able to do something like the following (possibly with custom scopes)

import click
from dishka import make_container, from_context, Provider,
from dishka.integrations.click import FromDishka, setup_dishka, dishka_option

UserName = NewType("Userame", str|None)

class Interactor:
   def __init__(self, user: Username):
      self.user = user
   def __call__(self):
       return self.user

class FunProvider(Provider)
   username = from_context(UserName)
   interactor = provide(Interactor)

@click.group()
@click.pass_context
def main(context: click.Context):
    container = make_container(FunProvider)
    setup_dishka(container=container, context=context, auto_inject=True)

@main.command()
@click.option("--count", default=1, help="Number of greetings.")
@dishka_option("--username", default=None, provides=UserName)
def hello(count: int, interactor: FromDishka[Interactor]):
    """Simple program that greets NAME for a total of COUNT times."""
    for x in range(count):
        click.echo(f"Hello {interactor()}!")

main()

Currently click integration does not enter context on command. This is done because often there is another framework with its own scopes logic.
Here username looks more like date for interactor, than something related to dependencies. But anyway, we'll think more

From my current point of view groups is  the place for configuration of app+container. Command - is one of the scenarios to trigger. We do not pass parsed data from web framework handlers to container, same is here.
But anyway, it is a place for improvement, though it is not yet clear in which way we should develop

One of the options here is to enter nested scope manually inside command handler. You can pass context to context manager.
If you need, you can create container with scope RUNTIME, so the next scope will be APP

In my case, I'm using custom scope's anyway because it's not a webapp


Changed margin side for app name link tag

Fixes #53

Thanks!

@michaeldyrynda seems that there was no problem with the previews mr-6, but since my template was for both LTR/RTL directions, I thought that it should be ml-6 bor both dirs.
So expect my apologies and roll-back, please.


Axi-symmetric support

Dear all,
Is there axis-symmetric co-ordinate (Cylindrical  #-- RZ) support readily available in MFEM library.
Please suggest.

Hi @cjoycd,
There is no simple user-level support for axisymmetric problems, but switching to an axisymmetric formulation is usually not hard -- you have to add the "2 pi r" factors in the bilinear form integrator's Coefficient and transform derivatives appropriately, see for example this paper: https://computation.llnl.gov/projects/blast/CF-12.pdf.
Hope this helps,
Tzanio

Thanks !, Infact I was particularly interested in the axisymmetric
implementation of the "laghos" miniapp. I will go through the paper.
Regards
On Thu, Dec 6, 2018, 10:27 PM Tzanio Kolev<EMAIL_ADDRESS>wrote:

Hi @cjoycd https://github.com/cjoycd,
There is no simple user-level support for axisymmetric problems, but
switching to an axisymmetric formulation is usually not hard -- you have to
add the "2 pi r" factors in the bilinear form integrator's Coefficient and
transform derivatives appropriately, see for example this paper:
https://computation.llnl.gov/projects/blast/CF-12.pdf.
Hope this helps,
Tzanio
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mfem/mfem/issues/696#issuecomment-444946385, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AijUoGKPPDGtQ1S_BT5LIEARzFq8l13cks5u2Ux0gaJpZM4ZG4Ai
.

Hi,
Is it planned to implement axisymmetric element support in MFEM in near
future ?
Regarding your answer to modify the coefficients in BilinearForm
Integrators, Can you please more specific in which functions/class it has
to be done, so that the modifications/changes can be a general one for the
users.
Regards
On Thu, Dec 6, 2018, 10:27 PM Tzanio Kolev<EMAIL_ADDRESS>wrote:

Hi @cjoycd https://github.com/cjoycd,
There is no simple user-level support for axisymmetric problems, but
switching to an axisymmetric formulation is usually not hard -- you have to
add the "2 pi r" factors in the bilinear form integrator's Coefficient and
transform derivatives appropriately, see for example this paper:
https://computation.llnl.gov/projects/blast/CF-12.pdf.
Hope this helps,
Tzanio
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mfem/mfem/issues/696#issuecomment-444946385, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AijUoGKPPDGtQ1S_BT5LIEARzFq8l13cks5u2Ux0gaJpZM4ZG4Ai
.

Dear Mark,
Ok, Thanks!. I am interested in implementing the axisymmetric version of
Laghos using the paper Tzanio mentioned in two temp model for laser driven
dynamics. There, I have to modify the mass & force matrix and to include
few additional terms in artificial viscosity. I was wondering, at least for
this purpose, can we have separate routines defined for mass & force matrix
assembly in which the "r" terms (neglecting the 2*pi factor) are multiplied
(I would also liked to know which routines/modules it could be ideal).
Prior to that, I am interested in the implementation of radiation transport
& electron conduction, where in the first step a flux limited diffusion
(FLD) scheme will be used. Here, also the electron-heat & radiation fluxes
are required to be multiplied with "r". I will see to implement the
diffusion calculation implemented in RZ co-ordinates first. In 3D these are
somewhat straightforward.
Thanks & Regards

Dr. Sijoy C. D.       *Scientific Officer (F) *
Computational  Analysis  Division  (CAD)
Bhabha Atomic Research Centre (BARC)
Visakhapatnam, AP, India,  PIN - 530012
Ph: 0891-2892156 (O),<PHONE_NUMBER>0 (M)
On Sun, Dec 9, 2018 at 12:29 PM Mark L. Stowell<EMAIL_ADDRESS>wrote:

Hi, @cjoycd https://github.com/cjoycd ,
I don't believe there is a general method to support axisymmetric problems
(aside from the procedure outlined in the paper that Tzanio mentioned).
What you need to do is rewrite your differential equation in terms of
cylindrical coordinates and use the appropriate boundary conditions. The
specifics of how to accomplish this depends upon your differential equation.
It might be very useful for MFEM to provide a couple simple examples,
similar to ex1 or ex3. Is there a particular PDE you're interested in?
Best wishes,
Mark
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mfem/mfem/issues/696#issuecomment-445564299, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AijUoCYtBmthSQjgjXelz2ADMW8y45Oqks5u3WSMgaJpZM4ZG4Ai
.


Complete Parasitic Extraction on Placed & Routed Design

Needs #208 to be resolved first

Started implementation in #191. Completed in #228.  Currently doesn't use a centralized circuit representation (#208) but simply dumps out text.
Awaiting model files to validate (See #206) and tie into system-level flow. Implementation can be improved but closing this issue for now.


Parallelism control on *-all commands

An attempt to continue the work in https://github.com/gruntwork-io/terragrunt/pull/636, I added a few concurrency integration tests based on times and buckets
Given n modules when --terragrunt-parallelism is set to p we'll initially have p parallel module executions (this is a bucket or batch of executions), these executions talk with a server that simply sleeps for sleep seconds and then returns the server time, assuming that the first request finished at time start if we know that the initial p executions return in at most k seconds the initial times will look like this:
first_bucket = [e_1, e_2, ... e_p]
times = [e_time1, ..., e_timep]          // unsorted

min(times) = start
max(times) = start + k

Because it's impossible to know which bucket an execution belongs to I'm instead hoping that after sorting all of the times we have a clear definition of the boundaries between buckets

differences between items in different buckets is at least sleep (in the impl timeBetweenBuckets
differences between items in the same bucket is at most k (in the impl timeInsideBucket

I'm using the data http provider and the during apply the time it takes to download the provider skews some of these numbers, during my local tests I've never encountered a case where k > sleep but it's nevertheless a possible case
Some execution examples:
Parallelism test n=4 p=2 timeBetweenBuckets=20 timeInsideBucket=10
// 0s diff in the first bucket, 2 seconds in the second bucket
sortedTimes=[1586136362<PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER>]

// 8s diff in the first bucket, 9 seconds in the second bucket, this test was close to failing
sortedTimes=[1586136485<PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER>]

// 1s diff in the first bucket, 3 seconds in the second bucket
sortedTimes=[1586136690<PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER>]

// 0s diff in the first bucket, 2 seconds in the second bucket
sortedTimes=[1586136916<PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER>]

This test failed when I tried to run all of the integration tests, probably because of my network being throttled by all the requests
// 16s diff in the first bucket, 15 seconds in the second bucket
sortedTimes=[1586137285<PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER>]

Update
I've made some tradeoffs to have better control over the boundaries:

using local state instead of remote state in the integration tests
I'm fetching the plugins on terragrunt plan-all instead of apply-all

+1 to this feature. eagerly waiting for this.

Using the pull request branch and seems to work pretty well. Please add the option to ./cli/cli_app.go as well so users know the feature is there.
And +1 for merge!

All tests passed! Merging now. Thanks for the contribution and working hard to get the tests working too. 🍺

https://github.com/gruntwork-io/terragrunt/releases/tag/v0.23.16

@brikis98 Thanks but I just added the tests, all the credits for the concurrency control implementation go to @stephengroat


Updates: Users Lookup + Category Colors and Bookit Reference

Assign the PR to yourself. 🙂
If you can leave a before-after screenshot, that would be helpful for comparison.
Submit separate PRs for separate scripts (in the future). It helps avoid confusion.


ngx_http_rewrite_module support

Summary
Looking to use an nginx if statement for detecting if the connections is coming from CloudFlare.  From what I can tell, the version of nginx shipped with the kong container does not support this.  Is there a way to add support?
I'm trying to implement the if statement found here - https://gist.github.com/Doonga/dc91f2c52f17c9931e269966dfcb956d#file-realip-cf-haproxy-conf-L30
Additional Details & Logs

Kong version ($ kong version) = 0.10.3
Operating System: Docker image tag kong:0.10.3

Hi,
If you want to use custom Nginx directives, please have a look at https://getkong.org/docs/0.11.x/configuration/#custom-nginx-configuration-embedding-kong.
You may also consider writing a custom plugin if you have more complex application logic requirements: https://getkong.org/docs/0.11.x/plugin-development/.
Please also note that Github issues are not the appropriate forum for questions like this. Please consider posting to Gitter or the mailing list as noted here: https://github.com/Mashape/kong/blob/master/CONTRIBUTING.md#where-to-seek-for-help. Thank you!


Deploy on Firebase?

How can we deploy this app on firebase as it is ? can you please tell us in step by step. thanks

You can use this link how to connect Laravel in PostgreSQL database.
How to use PostgreSQL with Laravel
as long you know your connection string you can easily follow the instruction.


prettierd: presence of package.json is insufficient for deciding if prettierd should attach

May help with: https://github.com/stevearc/conform.nvim/issues/268
the only question we can ask if prettier should be enable is if there is a prettier config file

Unfortunately I can't take this change because prettier can use package.json for its configuration (see the link in the comment https://prettier.io/docs/en/configuration.html). You could make this change only in your local config, or you could try only installing prettier locally. If the prettier executable is not found, it won't be run.

silly package.json configs. thanks!


Vector map variant

Change data structure of safe JObject from Map to a custom VectorMap implementation which preserves key ordering on insertion of elements
Still to do

Specializations for 1 .. 6n length VectorMap (same as Map implementation)
Benchmarks
Override more methods for performance (i.e. builders)

Codecov Report

Merging #19 into master will decrease coverage by 0.27%.
The diff coverage is 30.95%.

@@            Coverage Diff             @@
##           master      #19      +/-   ##
==========================================
- Coverage   44.64%   44.36%   -0.28%
==========================================
  Files           5        6       +1
  Lines         663      710      +47
  Branches      140      142       +2
==========================================
+ Hits          296      315      +19
- Misses        367      395      +28

Impacted Files
Coverage Δ

jvm/src/main/scala/scalajson/ast/JValue.scala
71.84% <ø> (-0.16%)
:arrow_down:

...s/src/main/scala/scalajson/ast/unsafe/JValue.scala
0% <0%> (ø)
:arrow_up:

js/src/main/scala/scalajson/ast/JValue.scala
0% <0%> (ø)
:arrow_up:

...n/scala/scala/collection/immutable/VectorMap.scala
36.36% <36.36%> (ø)

...m/src/main/scala/scalajson/ast/unsafe/JValue.scala
61.11% <50%> (+0.46%)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d863974...cbaeca4. Read the comment docs.


Crash on start

The app crashes on start. This has begun a week ago (or two weeks) and most of the time insisting to start the app made it work again. Yesterday I tried to use another data provider in <IP_ADDRESS> and now it crashes after 1 second. Even the latest version <IP_ADDRESS> has the same problem. I run a:
adb logcat -d | grep -i akylas
akylas.txt
I'm not a programmer, so if I can do some more tests I'm at your service. LineageOS 20 on a OnePlus A5001
HTH,

@rlucassen2 really sorry to hear that. willake you a test build tomorrow so that I can get a bug report

Ok, no prob. I'm quite busy tomorrow but I will try to find some time.
R.

@rlucassen2 here is the test build https://github.com/Akylas/oss-weather/releases/tag/android%2Fsentry
Take your time to test. no rush!

Nope, immediate crash:
akylas.txt
Do you need the whole logcat or is the grepped one ok?

@rlucassen2 so it crashes with the test build? Did you try to restart the app just after. It should send me a bug report (if the crash does not happen too soon)

Yes, it's an A5010 indeed. When I start the app I see a black screen with the sun for approx 1 second. Here is the full log of minute 09:50 CET:
akylas.txt
R.

@rlucassen2 ok i got your log and i know what the error is. Just do not know where. Making a new test build for you. Thanks a lot for testing this!

I have another OnePlus A5000, LineageOS 20. OSS Weather <IP_ADDRESS> (IzzyOnDroid). This one works. I updated to <IP_ADDRESS> and this one works as well. I rebooted the A5010 to be sure I have a clean system, but it crashes immediately. I removed the app and reinstalled the version <IP_ADDRESS> and now it works. Must be some config issue I fear. I changed the data source to Meteo France and Opoenweather but it still works.

I altered a few times the data sources and it keeps working. Maybe the new version is ok but is not able to work with a corrupted config?

@rlucassen2 ok glad it works again. I think you were in a strange state. If it happens again with the next build i ll get a report.
as for comparing data sources yes it is somehting i want to do (we have an issue about this). Though it is a lot of work and will require a new design. Will mostly do it as a graph view, not as you see it in the app today.

Ok,thnx, I will get back to work now :-(

@rlucassen2 will close this for now. hope it won't happen again


Can make a call to the model because: ReferenceError: Headers is not defined

Hello I'm facing an issue trying to use the new version of langchain.
Error message: ReferenceError: Headers is not defined
Node.js version: v16.17.0
Os version: Ubuntu 22.04.2 LTS

The error is fixed after upgrading from v16 to v18

Hi, yes upgrading to Node 18 fixes that issue, see also this section in the docs https://js.langchain.com/docs/getting-started/install#unsupported-nodejs-16

Thank you @nfcampos for the feedback :+1: .
Actually for the package to work in node 16, I imported Headers, Request and fetch from node-fetch from
dist/util/axios-fetch-adapter.js
import fetch, {Headers, Request} from "node-fetch";

May be should be included in the docs


Request for more specific examples

Hello! Been trying to wrap my head around this for a few days now. I'm struggling with building feed generators which rely upon user profiles or an authenticated user's personalized feed. Would it be possible to get some examples of say, a "mutuals" feed and a feed based on something to do with the poster's profile? Maybe a feed with only posts from users whose handles start with the letter 'A'?

Hey there, you can see some feed examples over here: https://github.com/bluesky-social/atproto/tree/main/packages/bsky/src/feed-gen
Altho that runs on our appview service which has an index of the entire network.
We're going to keep this example simple for now. The dev discord may be a good place to ask around for more examples


[BUG] Minor bug - production cost overlaps parameters tab

Might only be for the production cost label.
The materials tab causes strange behaviour.

Thank you, sending this to be fixed in the next patch.

Will be fixed in the next development cycle, along with an update of the "Developer" mode overhaul.


Use pyproject.toml for project's metadata

@vmalloc This PR was forgotten by me.
I've rebased it over develop (because it had conflict with setup.cfg) and fixed the Makefile
Can you take a look so I could merge?


generate-zephyr-dts.py: refactored version V2

In reference to:https://github.com/litex-hub/litex-renode/pull/34
The changes are part of an effort to enable platformio to handle the
different litex-board variants for the zephyr framework.
The resulting changes are aimed for better maintainability.

Removed the dependency on the intermediate interpretations from
the configuration class. No external python modules required.
Less code with similar output results.
Switched to JSON as it is better in preserving structure than CSV
format.
Refactored the formatting and translation handlers.
changed uart io size parameter to 0x20, to include last uart address:
uart_rxfull = CSR_BASE + 0x1c

Example session:
$ generate-zephyr-dts.py --dts - --config - src/board.csr.json
Generating overlay for: uart
Generating overlay for: timer0
Generating overlay for: ethmac
Generating overlay for: i2c0
dtsi key 'i2c0' not found, disable i2c0
Generating overlay for: main_ram
No overlay handler for: ctrl at 0xf0000000
No overlay handler for: ethphy at 0xf0001000
No overlay handler for: identifier_mem at 0xf0001800
No overlay handler for: sdram at 0xf0002000
No overlay handler for: spiflash at 0xf0002800
DST output:
&uart0 {
reg = <0xf0003800 0x20>;
interrupts = <0x0 0>;
};
&timer0 {
reg = <0xf0003000 0x40>;
interrupts = <0x1 0>;
};
&eth0 {
reg = <0xf0000800 0x80 0x80000000 0x2000>;
interrupts = <0x2 0>;
};
&i2c0 {
status = "disabled";
};
&ram0 {
reg = <0x40000000 0x400000>;
};
Config output:
-DCONFIG_UART_LITEUART=y -DCONFIG_LITEX_TIMER=y -DCONFIG_ETH_LITEETH=y -DCONFIG_I2C_LITEX=n
Signed-off-by: Henk Vergonet<EMAIL_ADDRESS>

@mateusz-holenko

Let's discuss the CSV vs JSON format. As mentioned in https://github.com/litex-hub/litex-renode/pull/34#discussion_r672353058 and in https://github.com/litex-hub/litex-renode/pull/34#discussion_r673928089 there are currently projects that rely on CSV parsing. I wouldn't like to break the compatibility unless there is a very good reason for that.

You can squash commits https://github.com/litex-hub/litex-renode/pull/35/commits/20198ee76393dba0c5bf3ee327b5ed902f4c7d61 and https://github.com/litex-hub/litex-renode/pull/35/commits/df3f22ee5548b5e41a6dc1eaf71571cc6fd5756e and force push the branch.

You can squash commits 20198ee and df3f22e and force push the branch.

Hi Mateusz,
Both changes depend on b422d8c, so force pushing this will mean additional work by refitting the CSV parser. Maybe we should revisit when there is real demand for it. I am happy to let it go..

@hvegh thanks again for your contribution!
I gave it a thought and came to a conclusion that dropping support for CSV is the way to go - it reduces the complexity and makes scripts more usable/portable. I merged your changes to generate-zephyr-dts.py and refactored the rest of scripts removing CSV-related code.
The external projects using scripts from this repo will need to be updated to generate LiteX configuration in JSON format.


Feature / Request

Would be a useful feature if you could show the usage of each harvester. For example the ore miner. if you looked at the uses (right click) in JEI it would show all the ores that could be collected at that level of harvester. And so on. Another is the mob harvester. what drops each mob has a chance to drop.

I was going to say that it's not really needed because of mods like Just Enough Resources (JER), which, for example, shows mob drops (the Mob Harvester doesn't have a custom loot table, it just drops whatever the configured mob would have, including player kill drops). However, something like the Bio Harvester is less obvious, so I think I'll just add it for all of them if I can. Thanks for the suggestion!

On second thought, it might not work, since the Harvesters don't determine their drops until they load and the Mob Harvester doesn't even have remotely predictable outputs, since it's based on simulating a mob dropping its items. I'll describe how to determine what items are in the tags of each Harvester on the mod page though. If I later find it more doable, I'll try to add it. Sorry!


Access token not removed after logout

Related: https://github.com/FusionAuth/fusionauth-react-sdk/issues/22
The access and refresh token cookies are set by the example server side code. Since it is set by a server side component, it is not accessible to the react SDK to delete on logout.
When you click logout, you are sent to FusionAuth's logout link: https://github.com/FusionAuth/fusionauth-react-sdk/blob/main/src/providers/FusionAuthProvider.tsx#L100
This kills the FusionAuth managed cookies. We also need to remove any server side non FusionAuth set cookies, such as the access_token.
After the FusionAuth logout URL is processed, it calls the logout url. (Set here by default; https://github.com/FusionAuth/fusionauth-example-react-sdk/blob/main/kickstart/kickstart.json#L60 ). That'd the proper place to nuke the access token and refresh token cookies.
So I think the best path is to create another server side route which receives the logout request, nukes the cookies, and then redirect to the first, unauthenticated page of the react app.

@mooreds It looks like this issue has been resolved via the referenced PRs. Are we ready to close this issue?

I think the only reason to keep this open is to make sure that the same behavior happens in the other SDKs.

I think the only reason to keep this open is to make sure that the same behavior happens in the other SDKs.

...circling back around to this. Since that access_token cookie (since been renamed to app.at) is httpOnly it's not readable by JavaScript. So there should be no action needed for any of the JavaScript SDKs.
I've verified that it's removed by the server in the react example app as well as the hosted endpoint with these followup issues.
https://github.com/FusionAuth/fusionauth-example-react-sdk/issues/27
https://github.com/FusionAuth/fusionauth-quickstart-javascript-react-web/issues/7
With that, closing this issue.


Support Twitter Bootstrap v 2.0

Add support of Twitter's Bootstrap http://twitter.github.com/bootstrap/

@thaold Good idea, thanks.  Working on adding support very soon (this week, hopefully).  @edave Thanks, but it's more complicated than that to support Twitter Bootstrap.

@techiferous Thanks, that sounds great!

I just released tabulous version 1.2.0, which adds support for Twitter Bootstrap version 2.


Allow saving of a library list and swapping between saved lists

It is common to work in multiple applications (or multiple versions of the same application) which have different library lists.
It would be great to have a way to set a library list, then save it for later use so that you can easily switch between them.

This is an awesome feature. The code has been written and I'm to open the PR. Before it can get released, I need to work on the documentation and then it should be out in 0.6.0.

@worksofliam This is amazing!  It was cool to watch you think through this and code it within hours of me creating the issue.


Front End Restructure - Offline-first (WIP)

I've started working on updating the offline-first docs. This PR is WIP

I will add links to all subpages.

We should reference all subpages. Where can we add a link to troubleshooting?


fix(xhr): inner onreadystatechange should not use zoneAwareListener

fix https://github.com/angular/angular/issues/17167,
zone.js will patch xhr, and add onreadystatechange internally,
this onreadystatechange just for invoke the xhr MacroTask, so it should
not trigger ZoneSpec's callback.
in this commit, use original native addEventListener/removeEventListener
to add internal onreadystatechange event listener.
if (listener) {
  // don't use patched removeEventListener
  oriRemoveListener.apply(data.target, ['readystatechange', listener]);
}
const newListener = data.target[XHR_LISTENER] = () => {
    if (data.target.readyState === data.target.DONE) {
    // sometimes on some browsers XMLHttpRequest will fire onreadystatechange with
    // readyState=4 multiple times, so we need to check task state here
    if (!data.aborted && (XMLHttpRequest as any)[XHR_SCHEDULED] &&
        task.state === 'scheduled') {
      task.invoke();
    }
  }
};
// don't use patched addEventListener
oriAddListener.apply(data.target, ['readystatechange', newListener]);

This seems to have broken IE support (at least from my testing), raised an issue here: #816


Excluding the first part of a chapter reference in a category confuses random

Because of #42 I can't just use a short --exclude to demonstrate this, but given this index file:
# index.yaml
metadata:
    version: 0
    original_version: 0
description: 'Index of verses for '
verses:
    2024/01/01:
        reference: Daniel 6:1-7:19

And then running:
today random -M1 --exclude-index index.yaml -c Apocalyptic

The today program will panic with this error:
panic: scripture reference not found

goroutine 1 [running]:
github.com/zostay/today/cmd.RunTodayRandom(0x105494680, {0x1400126abe0?, 0x4?, 0x104e557fc?})
        /Users/sterling/projects/go/src/github.com/zostay/today/cmd/random.go:119 +0x914
github.com/spf13/cobra.(*Command).execute(0x105494680, {0x1400126ab90, 0x5, 0x5})
        /Users/sterling/projects/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:985 +0x834
github.com/spf13/cobra.(*Command).ExecuteC(0x140008cc908)
        /Users/sterling/projects/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/sterling/projects/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041
github.com/zostay/today/cmd.Execute()
        /Users/sterling/projects/go/src/github.com/zostay/today/cmd/root.go:33 +0x24
main.main()
        /Users/sterling/projects/go/src/github.com/zostay/today/main.go:6 +0x1c

I don't understand yet why the Daniel 6 inclusion matters here since the Apocalyptic category only contains Daniel 7-8, but if I try to just exclude Daniel 7:1-19, then this panic does not occur.

After some digging, the issue is that the Subtract method that calculates the set difference between two verse references incorrectly handled subtracting from the beginning or end of the verse. So this operation worked correctly:
Daniel 7:1-12:13 (-) Daniel 7:1-19

Would correctly rewrite the subtracted reference as:
Daniel 7:20-12:13

However, this operation failed:
Daniel 7:1-12:13 (-) Daniel 6:1-7:19

As it incorrectly assumed that removal of the front would always match the first verse exactly, so the result was unchanged:
Daniel 7-12


REFERENCE: Pool Yield & Farm

Opening as draft PR to more easily track changes

Closing this PR, but leaving the branch open until F1 spec is done.


Write Script to translate Group --> Entitlement matrix into seed code

Managing the seeds for group --> entitlements is a nightmare.
We need the ability to be able to translate from the spreadsheet into seed code programatically without manually creating each and every line.
https://docs.google.com/spreadsheets/d/1yD-TTZ8B8hRXI7JX8wAf-9Hu_nJWfXfxyYbDTRCW6WA/edit#gid=0

Implemented this in 5c3135d9896cb48eb092792c342f55b0de28715e and<PHONE_NUMBER>4bf9a11d4d86d0ffc7fa5ffc7d5df6
Marking as complete


Add pympler python package back

What does this PR do?
Adds pympler back. This is hit by the status py subcommand (on this file).
Motivation
This got lost in the big changes to how we build dependencies (#23094).
The way the code is organized, as it is right now, this is technically not a dependency linked to integrations, and therefore I've decided to create a separate definition for it to remind ourselves that we may want to do something to avoid this kind of stray dependency.
Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes
Confirmed that the command no longer complains of the missing library.

/merge


Fix for fatal exception if persisted collection was unserialized

UnitOfWork could set document manager again but not sure where it should check for dm presence

:+1:

@notrix thanks for the PR! Would you mind updating getTypeClass method to throw an exception with different message (for instance "No DocumentManager is associated with this PersistentCollection, please set one using setDocumentManager")? We could also get typeClass once again if it's null and DocumentManager is available.

@notrix I've included your commits in #1411 and added few more things from me, thanks for starting this!
Also I'm sorry for no looking into this sooner, I haven't checked hanging PRs for a while and there are no email notifications about new commits on their own.


bazel-bin command not found

I am having issues while building pip package.I am building tensorflow with cpu configurations Steps i followed
bazel release= 0.4.5, ubuntu -version = 14.04 LTS

bazel clean
./configure
bazel build --config op

kush@kush-Lenovo-B40-80:~/machine_learning/deeplearning/tensorflow$ bazel build --config=op
Warning: ignoring LD_PRELOAD in environment.
WARNING: Config values are not defined in any .rc file: op
INFO: Found 0 targets...
INFO: Elapsed time: 2.365s, Critical Path: 0.03s

Now when i try to run
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

kush@kush-Lenovo-B40-80:~/machine_learning/deeplearning/tensorflow$ bazel-bin/tensorflow/tools/pip_package/build_pip_package
bash: bazel-bin/tensorflow/tools/pip_package/build_pip_package: No such file or directory

But then i tried sudo it gives
sudo: bazel-bin/tensorflow/tools/pip_package/build_pip_package: command not found
bazel is installed in my system. i have checked it.
I also tried giving full path in bazel-bin
sudo: /usr/bin/bazel-bin/tensorflow/tools/pip_package/build_pip_package: command not found
i have bazel release = 0.4.5
Can anyone help me on this?

Can you do those steps and let us know where it goes wrong?
Make sure you are executing ./configure in the tensorflow folder that is inside the serving folder

@ammarasmro  i got same error. PLease see the output of each and every step

./configure

`kush@kush-Lenovo-B40-80:~/Desktop/serving/tensorflow$ ./configure
Please specify the location of python. [Default is /usr/bin/python]: /usr/bin/python2.7
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:
Do you wish to use jemalloc as the malloc implementation? [Y/n] y
jemalloc enabled
Do you wish to build TensorFlow with Google Cloud Platform support? [y/N]
No Google Cloud Platform support will be enabled for TensorFlow
Do you wish to build TensorFlow with Hadoop File System support? [y/N]
No Hadoop File System support will be enabled for TensorFlow
Do you wish to build TensorFlow with the XLA just-in-time compiler (experimental)? [y/N]
No XLA support will be enabled for TensorFlow
Found possible Python library paths:
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
Please input the desired Python library path to use.  Default is [/usr/local/lib/python2.7/dist-packages]
Using python library path: /usr/local/lib/python2.7/dist-packages
Do you wish to build TensorFlow with OpenCL support? [y/N] n
No OpenCL support will be enabled for TensorFlow
Do you wish to build TensorFlow with CUDA support? [y/N] n
No CUDA support will be enabled for TensorFlow
Configuration finished
Warning: ignoring LD_PRELOAD in environment.
......................................
INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
Warning: ignoring LD_PRELOAD in environment.
................
INFO: All external dependencies fetched successfully.
`
2. ```
kush@kush-Lenovo-B40-80:~/Desktop/serving/tensorflow$ bazel build --config=opt
Warning: ignoring LD_PRELOAD in environment.
INFO: Found 0 targets...
INFO: Elapsed time: 2.939s, Critical Path: 0.03s
kush@kush-Lenovo-B40-80:~/Desktop/serving/tensorflow$ ls

3.
`kush@kush-Lenovo-B40-80:~/Desktop/serving/tensorflow$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
bash: bazel-bin/tensorflow/tools/pip_package/build_pip_package: No such file or directory
`
4.
kush@kush-Lenovo-B40-80:~/Desktop/serving/tensorflow$ sudo !!
sudo bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
[sudo] password for kush:
sudo: bazel-bin/tensorflow/tools/pip_package/build_pip_package: command not found

The command you are writing does not really do anything.
Please follow the guide here to build pip package from sources:
https://www.tensorflow.org/install/install_sources
And please use stackoverflow with help on how to use bazel.

Following these instructions exactly, yields the same problem i.e. there is no file by the name of build_pip_package

You may have not installed bazel correctly. I had the same issue and then i understood that i forgot the step 4 of bazel 0.18.1 installation which is (in terminal):
export PATH="$PATH:$HOME/bin"


⚠ Bofrost.at has degraded performance

In 7932aa1, Bofrost.at (https://www.bofrost.at) experienced degraded performance:

HTTP code: 200
Response time: 1516 ms

Resolved: Bofrost.at performance has improved in 91831d3 after 20 minutes.


Monitored Object Contributor not listed

Hello,
The Monitoring Object Contributor role (56be40e24db14ccf93c37e44c597135b) mentioned in https://docs.microsoft.com/en-us/azure/azure-monitor/agents/azure-monitor-agent-windows-client is not listed/ documented here.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 99581afb-7950-6daa-7227-055d04446b7e
Version Independent ID: f1a5bf89-9e54-aede-3a9a-70788a95927b
Content: Azure built-in roles - Azure RBAC
Content Source: articles/role-based-access-control/built-in-roles.md
Service: role-based-access-control
GitHub Login: @rolyon
Microsoft Alias: rolyon

@vmhenard
Thanks for your feedback! I've assigned this issue to the author who will investigate and update as appropriate.

I don't see the Monitored Object Contributor role in the list Azure RBAC built-in roles:
https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles
@shayoniseth do you have additional information about the Monitored Object Contributor role that is referenced in this article?
https://docs.microsoft.com/en-us/azure/azure-monitor/agents/azure-monitor-agent-windows-client
thanks

#reassign: @shayoniseth

I would like to bump this request as I am seeing the same error.

#reassign: @nkiest

@rolyon What additional information do you need?

bumping this up, Monitored Object Contributor is still not listed

So the documentation is, what we call, bad.   The actual role that gets assigned if you follow the API is not Monitored Object Contributor, but Monitoring Contributor.  Thats the Azure Role you need.  If you follow the API it does work, but I'll admit the lack of Monitoring Contributor as a role threw me for a while as well.

There is actually a role defined for Monitored Object Contributor, you can see it if you query role definitions via API:
{
      "properties": {
        "roleName": "Monitored Objects Contributor",
        "type": "BuiltInRole",
        "description": "Can read and update Monitored Objects and associated Data Collection Rules.",
        "assignableScopes": [
          "/providers/Microsoft.Insights"
        ],
        "permissions": [
          {
            "actions": [
              "Microsoft.Insights/monitoredObjects/read",
              "Microsoft.Insights/monitoredObjects/write",
              "Microsoft.Insights/monitoredObjects/delete",
              "Microsoft.Insights/dataCollectionRuleAssociations/delete",
              "Microsoft.Insights/dataCollectionRuleAssociations/read",
              "Microsoft.Insights/dataCollectionRuleAssociations/write"
            ],
            "notActions": [],
            "dataActions": [],
            "notDataActions": []
          }
        ],
        "createdOn": "2022-01-21T18:03:29.9138960Z",
        "updatedOn": "2022-01-21T18:03:29.9138960Z",
        "createdBy": null,
        "updatedBy": null
      },

I think its because the assignable scope is not "/" or a management group or subscription scope hence its not visible in the gui for assignment. I think the only way to make assignments at the providers/microsoft.insights scope is via API / Powershell.


[mtsource] Cancelling a single adapter instance does not always work.

Describe the bug
Cancelling a single adapter instance does not always work. I'm sometimes seeing this error looping forever:
{"severity":"ERROR","timestamp":"2021-02-12T20:43:54.236556227Z","caller":"adapter/adapter.go:116","message":"Error while consuming messages","knative.dev/controller":"knative.dev.eventing-kafka.pkg.source.mtadapter.Reconciler","knative.dev/kind":"sources.knative.dev.KafkaSource","knative.dev/traceid":"cf185b2d-df81-4c6f-8fce-e63b75c68cff","knative.dev/key":"test-kafka-source-no-event-content-type-or-key-s512-v1betazcdjn/e2e-kafka-source-no-event-content-type-or-key-s512-v1beta1","error":"kafka: error while consuming 82637060-5bb4-470d-8b93-aebfcf41697c/4: kafka server: Request was for a topic or partition that does not exist on this broker.","stacktrace":"knative.dev/eventing-kafka/pkg/source/adapter.(*Adapter).Start.func2\n\tknative.dev/eventing-kafka/pkg/source/adapter/adapter.go:116"}

Expected behavior
A clear and concise description of what you expected to happen.
no error.
To Reproduce
Steps to reproduce the behavior.
Run the e2e tests and observe error.
Knative release version
Additional context
Add any other context about the problem here such as proposed priority

https://github.com/knative-sandbox/eventing-kafka/pull/406 fixes it.


Bug: Cannot exit code block without use of toolbar

Lexical version: v0.12.0
Steps To Reproduce

Create code block at end of a line
Try to exit with right arrow, clicking to the right of the block, Enter, or other key entries/inputs

The current behavior
Cannot exit a code block without use of the formatting toolbar
The expected behavior
Most editors allow a right arrow or a click outside (to the leading edge/cursor side) of the code block to 'exit' it and go back to unformatted text. In effect, you're 'stuck' in the code block.
I've submitted this as a bug as it seems like unexpected behavior, but I could see it as a feature request as well.

I think this is a bug, but not that that is inline code, not a code block (I think). This should work more like text formats such as bold and italic maybe

I'm a little confused by what you mean. Afaict, this does behave exactly like formats such as bold and italic (there's a code format). The problem I see is that for users, bold and italic have very common keyboard shortcuts while the code format does not. I believe this is why most text editors have different behavior for them, or generally less 'sticky' formatting behavior.

This PR would remove the 'sticky' text formatting across the board, although it could be limited to certain formats.

This PR would remove the 'sticky' text formatting across the board, although it could be limited to certain formats.

I'm not opposed to doing something like this just for inline code (or certain formats), but it'd probably be better if it was configurable somehow.
I'm also a bit worried about the blast radius of this change, as it's pretty core editor functionality. Maybe there's a way to do it at a higher leve somewhere.

It was a simple clarification for other readers. We can definitely change it to be easier to deal with - my point was just that it isn't a code block.

Got it, good clarification. I will note that the formatting toolbar tooltip says code block, even though it applies inline formatting.
Is there an example you can point two of configurability in other behavior like this that isn't implemented at the plugin level? This doesn't make sense to me to be a plugin prop.
Can we move discussion into the PR for that change? I agree it's core, but I didn't see a way to handle it higher without implementing something like a plugin that allows configurability to override core behavior.
One of the main issues here is that you can get stuck in formatting without use of the mouse. This example uses bold, but it's meant to highlight the fact that you can get 'stuck' in the inline code or other formats where your only option to 'reset' via keyboard is multiple new text nodes that you then have to remove.
https://github.com/facebook/lexical/assets/21961100/3420b6b6-c6bd-4a25-aa1b-7cfbd08e8c3a


Make context menu customizable

This PR adds support for custom context menu items.
Overview of changes:

Added prop called contextMenuItems
https://github.com/abichinger/vuefinder/blob/0dea1a006028c55a24286a2b9a1f9dae92cfbc49/src/components/VueFinder.vue#L124
New library exports: contextMenuItems and SimpleContextMenuItem
https://github.com/abichinger/vuefinder/blob/0dea1a006028c55a24286a2b9a1f9dae92cfbc49/src/index.js#L24
New example called: Custom context menu example
https://github.com/abichinger/vuefinder/blob/0dea1a006028c55a24286a2b9a1f9dae92cfbc49/examples/App.vue#L52
This is the type of an item:

type ContextMenuItem = {
    title: (i18n: App["i18n"]) => string;
    action: (app: App, selectedItems: DirEntry[]) => void;
    link?: (app: App, selectedItems: DirEntry[]) => void;
    show: (app: App, ctx: MenuContext) => boolean;
}

ty


[Bug]: Consecutive alerts won't work

Bug expectation
I expected that there should be two alerts, first was a confirm alert and next is a normal alert. but only first one was executed
Bug behavior

[ ] Flaky
[ ] PDF

Minimal, reproducible example
// sample.js
const puppeteer = require("puppeteer");

const delay = ms => new Promise(resolve => setTimeout(resolve, ms));

(async () => {
  const browser = await puppeteer.launch({ headless: false, slowMo: 100 });
  const page = await browser.newPage();
  page.on('dialog', async (dialog) => {
    console.log(dialog.message());
    await dialog.accept();
  });

  await page.goto("test.html", {waitUntil: 'networkidle2'});
  await browser.close();
})();

// test.html
<script>
  if (window.confirm("confirm")) {
    alert('test')
  }
</script>

Error string
no error
Puppeteer configuration
launch: {
    dumpio: true,
    headless: false,
    args: [
      '--no-sandbox',
      '--disable-setuid-sandbox',
      '--disable-dev-shm-usage',
      '--disable-software-rasterizer',
      '--disable-gpu',
      '--start-maximize',
    ],
    defaultViewport: {
      width: 1920,
      height: 1080,
    },
  },
  browserContext: 'default',

Puppeteer version
19.4.1
Node version
18.12.1
Package manager
yarn
Package manager version
3.3.1
Operating system
Linux

Sorry for bugging, it was not a bug. I misunderstood the dialog
I'll close this ticket


#13602 - Fix the dependenceis

Solved these fuckers
https://app.snyk.io/org/likvido/project/d747db53-a611-4002-9595-4697cab515d8

@spewu
:P Good point. I was obsessed fixed underlying problems. This should work too


Bug: findMany() with two large in filters with arrays of 32767 items each fails with Assertion violation, too many bind variables in prepared statement

Consider the following query when using the postgresql provider with Rust drivers:
const n = 32767
const ids = Array.from({ length }, (_, i) => i + 1)

await prisma.tag.findMany({
  where: {
    OR: [
      {
        id: { in: ids },
      },
      {
        id: { in: ids },
      },
    ],
  },
})

This results in an error with code: "P2035" and message:
Assertion violation on the database: `too many bind variables in prepared statement, expected maximum of 32767, received 65534`

This is a bug, as we would expect the corresponding SQL query to be chunked into smaller SELECT queries using at most 32767 parameters each, and with a combined result set matching:
SELECT "public"."tag"."id" FROM "public"."tag"
WHERE ("public"."tag"."id"
  IN ($1, $2, ..., $32767)
OR "public"."tag"."id"
  IN ($32768, $32769, ..., ,$65533)
)
OFFSET $65534

Note: the same issue arises if one uses AND rather than OR in the Prisma query above.

Prisma schema:
  generator client {
    provider = "prisma-client-js"
    previewFeatures = ["driverAdapters"]
  }

  datasource db {
    provider = "${provider}"
    url      = env("DATABASE_URL")
  }

  model Tag {
    id Int  @id
  }

Prisma version: 5.5.2

Linked issue: https://github.com/prisma/prisma/issues/23957

What is the progress on this bug?