The onRemove of game is be called when game is running.

Current bug behavior
The onRemove of game is be called when game is running.
Expected behavior
Don't be called;
Steps to reproduce
this is test code
import 'dart:async';

import 'package:flame/components.dart';
import 'package:flame/events.dart';
import 'package:flame/game.dart';
import 'package:flutter/material.dart';

///  flame:^1.8.2

void main() {
  runApp(const GameWidget.controlled(gameFactory: TestWidthGame.new));
}

// with TapCallbacks
class TestFirstZone extends PositionComponent with TapCallbacks {
  TestFirstZone({super.position, super.size}) : super(anchor: Anchor.center);
  @override
  void render(Canvas canvas) {
    super.render(canvas);
    canvas.drawRect(Rect.fromLTWH(0, 0, width, height), Paint()..color = const Color(0xff9999cc));
  }
}

// with null
class TestSecondZone extends PositionComponent {
  TestSecondZone({super.position, super.size}) : super(anchor: Anchor.center);
  @override
  void render(Canvas canvas) {
    super.render(canvas);
    canvas.drawRect(Rect.fromLTWH(0, 0, width, height), Paint()..color = const Color(0xffff66cc));
  }
}

class TestWidthGame extends FlameGame {
  @override
  Color backgroundColor() {
    return const Color(0xff9966cc);
  }

  @override
  FutureOr<void> onLoad() {
    // first
    add(TestFirstZone(position: size / 2, size: Vector2(160, 160)));

    // second
    // add(TestSecondZone(position: size / 2, size: Vector2(160, 160)));

    super.onLoad();
  }

  @override
  void onMount() {
    super.onMount();
    print("onMount");
  }

  @override
  void onRemove() {
    super.onRemove();
    // why this method is be called when only add TestFirstZone in onLoad method,
    // but not when only add TestSecondZone ?
    print("onRemove");
  }
}

@munsterlander this seems like it is due to detach being called, haven't had any time to investigate why detach is being called though, could you have a look?

Will do today

Ok, sorry, I could have answered this if I had looked at the code closer, but anyway, I got it all mocked up, running, then immediately realized why and it is technically the correct call and not a bug.  When you add a gesture callback (tap in this case), when the game first loads, if (game.firstChild<MultiTapDispatcher>() == null) { then it adds that gesture detector which forces the game to briefly unload and reload as it requires a different parent structure for the gesture detectors.
Now, @spydon we could continue that conversation about what constitutes a true onRemove, but as is, this is correct behavior because the game is being unloaded and then reloaded with the GestureDetector being the first child.
The code that matters - game.dart lines 356+:
  /// When a Game is attached to a `GameWidget`, this method will force that
  /// widget to be rebuilt. This can be used when updating any property which is
  /// implemented within the Flutter tree.
  @internal
  void refreshWidget() {
    gameStateListeners.forEach((callback) => callback());
  }

Finally, the GestureDetectorBuilder in game.dart that calls the refresh which is called by has_tappable_components.dart which is called by tap_callbacks.dart:
  /// Used internally by various mixins that need to use gesture detection
/// functionality in Flutter.
late final GestureDetectorBuilder gestureDetectors =
    GestureDetectorBuilder(refreshWidget)..initializeGestures(this);
    ```

So in closing, basically when it initially gets added, it causes the widget to be rebuilt, which is why you see `onRemove` being called, because it is actually being removed and reloaded.  Now, this happens only when you add the component that uses a gesture, BUT in my opinion, this should not change BECAUSE if you needed to know something about state in your game prior to adding a gesture, this gives you that opportunity to do that.

I would apologize up front for the long ramble, but hopefully Spydon can clean up my rambles, lol.

Ok, sorry, I could have answered this if I had looked at the code closer, but anyway, I got it all mocked up, running, then immediately realized why and it is technically the correct call and not a bug.  When you add a gesture callback (tap in this case), when the game first loads, if (game.firstChild<MultiTapDispatcher>() == null) { then it adds that gesture detector which forces the game to briefly unload and reload as it requires a different parent structure for the gesture detectors.
Now, @spydon we could continue that conversation about what constitutes a true onRemove, but as is, this is correct behavior because the game is being unloaded and then reloaded with the GestureDetector being the first child.
The code that matters - game.dart lines 356+:
  /// When a Game is attached to a `GameWidget`, this method will force that
  /// widget to be rebuilt. This can be used when updating any property which is
  /// implemented within the Flutter tree.
  @internal
  void refreshWidget() {
    gameStateListeners.forEach((callback) => callback());
  }

Finally, the GestureDetectorBuilder in game.dart that calls the refresh which is called by has_tappable_components.dart which is called by tap_callbacks.dart:
  /// Used internally by various mixins that need to use gesture detection
/// functionality in Flutter.
late final GestureDetectorBuilder gestureDetectors =
    GestureDetectorBuilder(refreshWidget)..initializeGestures(this);

So in closing, basically when it initially gets added, it causes the widget to be rebuilt, which is why you see onRemove being called, because it is actually being removed and reloaded.  Now, this happens only when you add the component that uses a gesture, BUT in my opinion, this should not change BECAUSE if you needed to know something about state in your game prior to adding a gesture, this gives you that opportunity to do that.
I would apologize up front for the long ramble, but hopefully Spydon can clean up my rambles, lol.

Aaah of course, then it all makes sense and it should not be marked as a bug. We should document this better in the lifecycle section of the docs.

I am about half way through with the tile tutorial.  I can knock out a doc update with another quick PR.  I will be working on Flame all day tomorrow.

Ok, sorry, I could have answered this if I had looked at the code closer, but anyway, I got it all mocked up, running, then immediately realized why and it is technically the correct call and not a bug. When you add a gesture callback (tap in this case), when the game first loads, if (game.firstChild<MultiTapDispatcher>() == null) { then it adds that gesture detector which forces the game to briefly unload and reload as it requires a different parent structure for the gesture detectors.
Now, @spydon we could continue that conversation about what constitutes a true onRemove, but as is, this is correct behavior because the game is being unloaded and then reloaded with the GestureDetector being the first child.
The code that matters - game.dart lines 356+:
  /// When a Game is attached to a `GameWidget`, this method will force that
  /// widget to be rebuilt. This can be used when updating any property which is
  /// implemented within the Flutter tree.
  @internal
  void refreshWidget() {
    gameStateListeners.forEach((callback) => callback());
  }

Finally, the GestureDetectorBuilder in game.dart that calls the refresh which is called by has_tappable_components.dart which is called by tap_callbacks.dart:
  /// Used internally by various mixins that need to use gesture detection
/// functionality in Flutter.
late final GestureDetectorBuilder gestureDetectors =
    GestureDetectorBuilder(refreshWidget)..initializeGestures(this);

So in closing, basically when it initially gets added, it causes the widget to be rebuilt, which is why you see onRemove being called, because it is actually being removed and reloaded. Now, this happens only when you add the component that uses a gesture, BUT in my opinion, this should not change BECAUSE if you needed to know something about state in your game prior to adding a gesture, this gives you that opportunity to do that.
I would apologize up front for the long ramble, but hopefully Spydon can clean up my rambles, lol.

i think is not good action,   i have a mixin  that do something  ,but  now  it  is not  correct  for me
here is code

mixin HasEventMessageHandler on Component {
//
//
@override
void onMount() {
super.onMount();
List messageList = [];
registerEventMessage(messageList);
if (messageList.isNotEmpty) {
final game = findGame()!;
if (game is HasEventMessageCenter) {
for (var msgType in messageList) {
game.mMessageManager.addListener(msgType, onEventMessage);
}
}
}
}
@override
void onRemove() {
super.onRemove();
List messageList = [];
registerEventMessage(messageList);
if (messageList.isNotEmpty) {
final game = findGame()!;
if (game is HasEventMessageCenter) {
for (var msgType in messageList) {
game.mMessageManager.remove(onEventMessage, msgType: msgType);
}
}
}
}
}

As I was saying, there is a conversation to be had about this, but technically, onRemove as is, is correct, because the widget that contains the FlameGame is being removed and replaced.  I can think of a couple of ways to do this, but the easiest would likely be to set a flag like this:
import 'dart:async';

import 'package:flame/components.dart';
import 'package:flame/events.dart';
import 'package:flame/game.dart';
import 'package:flutter/material.dart';

///  flame:^1.8.2

void main() {
  runApp(const GameWidget.controlled(gameFactory: TestWidthGame.new));
}

// with TapCallbacks
class TestFirstZone extends PositionComponent with TapCallbacks {
  TestFirstZone({super.position, super.size}) : super(anchor: Anchor.center);
  @override
  void render(Canvas canvas) {
    super.render(canvas);
    canvas.drawRect(Rect.fromLTWH(0, 0, width, height),
        Paint()..color = const Color(0xff9999cc));
  }
}

class TestWidthGame extends FlameGame {
  bool gestureComponentJustAdded = false;

  @override
  Color backgroundColor() {
    return const Color(0xff9966cc);
  }

  @override
  FutureOr<void> onLoad() {
    gestureComponentJustAdded = true;
    add(TestFirstZone(position: size / 2, size: Vector2(160, 160)));
    super.onLoad();
  }

  @override
  void onRemove() {
    super.onRemove();
    if (!gestureComponentJustAdded) {
      print("onRemove");
    } else {
      gestureComponentJustAdded = false;
    }
  }
}

So just basically wrap that block in your onRemove.  Another way would be to check if the first child is not the multi-gesture detector and a flag or such.
Regardless though, you should know that your game is being removed to only be added back but with the gesture detector and it is this way specifically for your use case.  As your demo code had two components and if you needed to know what your game was doing before the gesture detector was actually added, then now you have an event hook to do that.

As I was saying, there is a conversation to be had about this, but technically, onRemove as is, is correct, because the widget that contains the FlameGame is being removed and replaced. I can think of a couple of ways to do this, but the easiest would likely be to set a flag like this:
import 'dart:async';

import 'package:flame/components.dart';
import 'package:flame/events.dart';
import 'package:flame/game.dart';
import 'package:flutter/material.dart';

///  flame:^1.8.2

void main() {
  runApp(const GameWidget.controlled(gameFactory: TestWidthGame.new));
}

// with TapCallbacks
class TestFirstZone extends PositionComponent with TapCallbacks {
  TestFirstZone({super.position, super.size}) : super(anchor: Anchor.center);
  @override
  void render(Canvas canvas) {
    super.render(canvas);
    canvas.drawRect(Rect.fromLTWH(0, 0, width, height),
        Paint()..color = const Color(0xff9999cc));
  }
}

class TestWidthGame extends FlameGame {
  bool gestureComponentJustAdded = false;

  @override
  Color backgroundColor() {
    return const Color(0xff9966cc);
  }

  @override
  FutureOr<void> onLoad() {
    gestureComponentJustAdded = true;
    add(TestFirstZone(position: size / 2, size: Vector2(160, 160)));
    super.onLoad();
  }

  @override
  void onRemove() {
    super.onRemove();
    if (!gestureComponentJustAdded) {
      print("onRemove");
    } else {
      gestureComponentJustAdded = false;
    }
  }
}

So just basically wrap that block in your onRemove. Another way would be to check if the first child is not the multi-gesture detector and a flag or such.
Regardless though, you should know that your game is being removed to only be added back but with the gesture detector and it is this way specifically for your use case. As your demo code had two components and if you needed to know what your game was doing before the gesture detector was actually added, then now you have an event hook to do that.

i think is not good action, i have a mixin that do something ,but now it is not correct for me that game with mixin (HasEventMessageHandler)
here is code
mixin HasEventMessageHandler on Component {

//
//

@override
void onMount() {
  super.onMount();
  List<int> messageList = [];
  registerEventMessage(messageList);
  if (messageList.isNotEmpty) {
    final game = findGame()!;
    if (game is HasEventMessageCenter) {
      for (var msgType in messageList) {
        game.mMessageManager.addListener(msgType, onEventMessage);
      }
    }
  }
}

@override
void onRemove() {
  super.onRemove();
  List<int> messageList = [];
  registerEventMessage(messageList);
  if (messageList.isNotEmpty) {
    final game = findGame()!;
    if (game is HasEventMessageCenter) {
      for (var msgType in messageList) {
        game.mMessageManager.remove(onEventMessage, msgType: msgType);
      }
    }
  }
}
}

how can handle this if i have multiple mixin for game ,
doc says :
/// See also:
/// - [onRemove] that is called every time the component is removed from the
/// game tree
void onMount() {}
/// Called right before the component is removed from the game.
///
/// This method will only run for a component that was previously mounted into
/// a component tree. If a component was never mounted (for example, when it
/// is removed before it had a chance to mount), then this callback will not
/// trigger. Thus, [onRemove] runs if and only if there was a corresponding
/// [onMount] call before.
void onRemove() {}

As I was saying, there is a conversation to be had about this, but technically, onRemove as is, is correct, because the widget that contains the FlameGame is being removed and replaced. I can think of a couple of ways to do this, but the easiest would likely be to set a flag like this:
import 'dart:async';

import 'package:flame/components.dart';
import 'package:flame/events.dart';
import 'package:flame/game.dart';
import 'package:flutter/material.dart';

///  flame:^1.8.2

void main() {
  runApp(const GameWidget.controlled(gameFactory: TestWidthGame.new));
}

// with TapCallbacks
class TestFirstZone extends PositionComponent with TapCallbacks {
  TestFirstZone({super.position, super.size}) : super(anchor: Anchor.center);
  @override
  void render(Canvas canvas) {
    super.render(canvas);
    canvas.drawRect(Rect.fromLTWH(0, 0, width, height),
        Paint()..color = const Color(0xff9999cc));
  }
}

class TestWidthGame extends FlameGame {
  bool gestureComponentJustAdded = false;

  @override
  Color backgroundColor() {
    return const Color(0xff9966cc);
  }

  @override
  FutureOr<void> onLoad() {
    gestureComponentJustAdded = true;
    add(TestFirstZone(position: size / 2, size: Vector2(160, 160)));
    super.onLoad();
  }

  @override
  void onRemove() {
    super.onRemove();
    if (!gestureComponentJustAdded) {
      print("onRemove");
    } else {
      gestureComponentJustAdded = false;
    }
  }
}

So just basically wrap that block in your onRemove. Another way would be to check if the first child is not the multi-gesture detector and a flag or such.
Regardless though, you should know that your game is being removed to only be added back but with the gesture detector and it is this way specifically for your use case. As your demo code had two components and if you needed to know what your game was doing before the gesture detector was actually added, then now you have an event hook to do that.

i think is not good action, i have a mixin that do something ,but now it is not correct for me that game with mixin (HasEventMessageHandler)
here is code
mixin HasEventMessageHandler on Component {

//
//

@override
void onMount() {
  super.onMount();
  List<int> messageList = [];
  registerEventMessage(messageList);
  if (messageList.isNotEmpty) {
    final game = findGame()!;
    if (game is HasEventMessageCenter) {
      for (var msgType in messageList) {
        game.mMessageManager.addListener(msgType, onEventMessage);
      }
    }
  }
}

@override
void onRemove() {
  super.onRemove();
  List<int> messageList = [];
  registerEventMessage(messageList);
  if (messageList.isNotEmpty) {
    final game = findGame()!;
    if (game is HasEventMessageCenter) {
      for (var msgType in messageList) {
        game.mMessageManager.remove(onEventMessage, msgType: msgType);
      }
    }
  }
}
}

how can handle this if i have multiple mixin for game ,
doc says :
/// See also:
/// - [onRemove] that is called every time the component is removed from the
/// game tree
void onMount() {}
/// Called right before the component is removed from the game.
///
/// This method will only run for a component that was previously mounted into
/// a component tree. If a component was never mounted (for example, when it
/// is removed before it had a chance to mount), then this callback will not
/// trigger. Thus, [onRemove] runs if and only if there was a corresponding
/// [onMount] call before.
void onRemove() {}
one onRemove for one onMount

What are your wanting to achieve? That may be easier to guide you than discussing the event lifecycle as all those components are getting mounted and being removed, so the calls are right.

What are your wanting to achieve? That may be easier to guide you than discussing the event lifecycle as all those components are getting mounted and being removed, so the calls are right.

i want that don't call onRmove after calling onMount in flamegame,
or if flamegaem need to reload, you should call onMount after calling onRemove again.
Now i have a mixin on Component, the mixin overright onMount and onRemove, i add some data in onMount  mixin and remove it in onRemove.
if flamegame with mixin, the onRemove is being called after calling onMOunt when game is running, the data i adding data will be removed.

As I said, just add a boolean check with a check of the first child as a multi gesture detector is null, the your on remove code isn't called.
Please understand the lifecycle is correct. When you add a gesture detector, if it hasn't been loaded before, the game has to unload and reload with the gesture detector component as the parent, so on remove and on mount are the correct calls.
You just need to figure out a flag that works for your specific code needs.

sorry , i think lifecycle is wrong now.
if game need to unload and reload the component, ok, you can  do unload and reload, why you call onRemove when call unload and not call onMount when reload again?
the game lefecycle is: onLoad -> onGameResize -> onMount ->Update -> onRemove .
but now the onRemove being called and onMount not when the game unload and reload.
The result is : onRemove will be called twice and onMount once for game like my code.
why don't call onMount when reload the game?
and, i think it will affects the mixin that overright onMount and onRemove and the game with this mixin.
for example：
mixin ListenerHandler on Component {
  @override
  void onMount() {
    super.onMount();
    // add listener
  }

  @override
  void onRemove() {
    super.onRemove();
    // remove listener
  }
}

class MyGame extends FlameGame with ListenerHandler {
  // now the listener can't correctly work after unloaded and reloaded
  // because the onRemove is being called twice.
}

if i have on one mixin i can handle it ,but if i have a lot of mixin like this, i will do more work and possiblly make something wrong for some person don't know this rule.

Well, the issue comes down to lifecycle event names.  The reason onMount is not called again, is because it was already mounted and it was never unMounted to the widget "representative" parent.  It was removed though as it was physically removed from the tree.  Thus when it comes back it needs to be attached back to the Flutter widget tree.
So I have tried explaining this multiple times and I never really do a good job with it, but understand that the stateful Game Widget is actually a child to a stateless Flutter widget; because it is stateless, there are only two events - attach and detach.  You have to use the detach event to then fake a remove event.  That is the inherent problem with Flutter if you do not add Gesture Detectors immediately in your game.  You have to destroy the initial widget to then recreate a widget that has the Flutter (not Flame) detectors associated with it.  Your FlameGame still exists in memory, so nothing should change in it, but we need to pop it from the widget, store it temporarily, destroy the widget, add a new widget with the gesture detectors attached to it, and then restore your FlameGame.  The games state is still identical, BUT its important to pass that remove event into the FlameGame in case any user would need a hook into that event lifecycle exactly at that moment.
I hope that makes sense and as I was saying, its not wrong and its not a bug.  It is just the way Flutter and Flame work.

The games state is still identical, BUT its important to pass that remove event into the FlameGame in case any user would need a hook into that event lifecycle exactly at that moment.

I know you have explained this earlier, but what was the reason that we didn't call just onDetach instead of onRemove? Because I can agree with OP that the lifecycle now feels inconsistent and you can't use it properly without having to do checks on the state in there.

Well, the issue comes down to lifecycle event names. The reason onMount is not called again, is because it was already mounted and it was never unMounted to the widget "representative" parent. It was removed though as it was physically removed from the tree. Thus when it comes back it needs to be attached back to the Flutter widget tree.
So I have tried explaining this multiple times and I never really do a good job with it, but understand that the stateful Game Widget is actually a child to a stateless Flutter widget; because it is stateless, there are only two events - attach and detach. You have to use the detach event to then fake a remove event. That is the inherent problem with Flutter if you do not add Gesture Detectors immediately in your game. You have to destroy the initial widget to then recreate a widget that has the Flutter (not Flame) detectors associated with it. Your FlameGame still exists in memory, so nothing should change in it, but we need to pop it from the widget, store it temporarily, destroy the widget, add a new widget with the gesture detectors attached to it, and then restore your FlameGame. The games state is still identical, BUT its important to pass that remove event into the FlameGame in case any user would need a hook into that event lifecycle exactly at that moment.
I hope that makes sense and as I was saying, its not wrong and its not a bug. It is just the way Flutter and Flame work.
Edit: Again, all you need is a flag to capture when you first add a tappable component. After that, you don't need to worry about it unless you are removing gesture detectors.

i know what you said.
may i ask a question? why don't add the Gesture Detectors immediately when creating the Game Widget?
i guess every game needs Gesture Detectors. it is right?

every  response is good, thanks !

i know what you said. may i ask a question? why don't add the Gesture Detectors immediately when creating the Game Widget? i guess every game needs Gesture Detectors. is it right?

They do not, there are different types of input systems that can be used, like keyboard and gamepads for example.
So with this system Flame dynamically adds only the detectors that it needs.

The games state is still identical, BUT its important to pass that remove event into the FlameGame in case any user would need a hook into that event lifecycle exactly at that moment.

I know you have explained this earlier, but what was the reason that we didn't call just onDetach instead of onRemove? Because I can agree with OP that the lifecycle now feels inconsistent and you can't use it properly without having to do checks on the state in there.

Mainly because that event did not exist but I would say additionally because it's being removed but not disposed. This goes back to the stateful vs stateless widget event names and the intermixing that was done previously.
For v2, I agree, there should be more events and it should be clearer, otherwise if it was done now, it would be a pretty huge breaking change. I can do it now though and we can do some testing around it.

i think that the falmegame is a component and it is should do FOLLOW the lifecycle of component. Otherwise, it will make people feel confused, like me. That's what I want to express.
every response is good, thanks !

I like to call FlameGame a quasi-component because yes it extends a component, but not really.

Mainly because that event did not exist but I would say additionally because it's being removed but not disposed.

Detach does not mean dispose though, detach is exactly what it does here and then re-attaches again.

For v2, I agree, there should be more events and it should be clearer, otherwise if it was done now, it would be a pretty huge breaking change. I can do it now though and we can do some testing around it.

To do a onDetach call instead of onRemove wouldn't be that huge breaking change, since the onRemove call was just added in the last version and I don't think people have started using it yet. onDetach is also better to use since it isn't related to the Component lifecycle, so it doesn't interfere with that, but onAttach also has to be called when it comes back, similarly to how onMount should need to be called after onRemove has been called like OP mentioned, otherwise the state machine is broken.

Edit: For me though, onDetach feels slightly off as well, because in this instance, the game is being removed. I don't know, I would need to think like what all events would you have because the intermixing is confusing. Stateful / stateless and Flutter widget tree / Flame component tree.

I don't think the user needs to know when the widget is being re-attached when it is for changes like adding detectors, that should be an internal implementation detail for us to solve.

I like to call FlameGame a quasi-component because yes it extends a component, but not really, as it's also with Game class and the two have some overlap that clash imo.

The FlameGame is actually a full blown component, it can be added anywhere in the component tree, it doesn't have to be in the root. When it is in the root it has more responsibilities though.

The FlameGame is actually a full blown component, it can be added anywhere in the component tree, it doesn't have to be in the root. When it is in the root it has more responsibilities though.

Agreed, but that last sentence is why I say a quasi-component, because when it is root, it has a different behavior set.  A lot of the internal methods just act differently then if it was a regular component in the list of children.  Even embedded games within games, the FlameGame instance acts differently because child components can be attached to it, thus it then gets extended by Game, which then means many other things, but I digress.
FlameGame is a component (just with quirks) - :o)

I like to call FlameGame a quasi-component because yes it extends a component, but not really, as it's also with Game class and the two have some overlap that clash imo.

The FlameGame is actually a full blown component, it can be added anywhere in the component tree, it doesn't have to be in the root. When it is in the root it has more responsibilities though.

agreed, so the FlameGame should follow the lifecycle rule of component ,  onMount once and onRemove once.

We'll have to agree to disagree on this one lol.  Yes it's a component, but it's also special and is extended from Game as well.
I will say that the event names could be clearer and would still say that onRemove is correct because the game is being removed from the widget. The widget is what gets detached from the Flutter widget tree, but I digress.
@spydon I will ping you about this externally to get your thoughts on possible names.  I also have a diagram in my head that will map out the events.

We'll have to agree to disagree on this one lol. Yes it's a component, but it's also special and is extended from Game as well.

These events come from Component though and not from Game. It would be great to get some input from @st-pasha here since he wrote the dartdocs about that onRemove should be called from dispatch.

I will say that the event names could be clearer and would still say that onRemove is correct because the game is being removed from the widget. The widget is what gets detached from the Flutter widget tree, but I digress.

Then what would onDetach mean, since we already have that event to hook into in the game? I think we should probably keep all of the component lifecycle events to only the component tree as far as it is possible if we can't get it to work in a nice way for our users. The state machine shouldn't be able to go from onRemove to then keep on updating without going through onMount for example. Another idea is that we could filter out the calls to onRemove when the widget is reloaded due to our internal changes, like adding detectors.
I will have a chat with the rest of the team in our meeting today and see what they think!

So I dropped this in our chat but for @MiaoShichang, I hope this shows how the events (today) are impacted by the Flutter event lifecycle.  There are definitely events missing and you can say that onRemove should come from GameWidget dispose (it was originally there).
The main problem is there are two widgets that house a game and depending on what action a user is doing, it triggers different cascading events that don't necessarily cross paths.  The last PR I did was addressing memory leaks where onRemove was not called if you just killed the GameRenderBox because onRemove never got called, just onDetach.
Now obviously, you are seeing onRemove called because the game gets detached but not disposed.  This is where the discussion should come in about what should the event names really be, because the game was definitely removed but not disposed.  Disposed being permanent and removed not.  So even if the event was onDetach, the game is still removed, so should it call that event OR should it pass something to say the source of the removal, etc.
I am open to any discussion about this, I just hope I am making sense and this provides some clarity on how it works today.

Hey,
Just saying that the doc page about a game instance lifecycle (https://docs.flame-engine.org/latest/flame/game.html#lifecycle) is pretty irrelevant with the current onRemove behavior :
  @override
  void onRemove() {
    removeAll(children);
    processLifecycleEvents();
    Flame.images.clearCache();
    Flame.assets.clearCache();
    // Any other code that you want to run when the game is removed.
  }

This code leads to errors and bugs.

You just need a boolean to check the reason onRemove is being called.  Regardless, I have a potential solution proposed.

The last PR I did was addressing memory leaks where onRemove was not called if you just killed the GameRenderBox because onRemove never got called, just onDetach.

@munsterlander  , I suggest

I have split this out and now made Flame aware if it is a Gesture Detector being the cause of the reload.  If so, then onRemove is no longer called.  This should fix your issue and @Skyost's issue.  So apologies up front for causing this bug with the last PR.  I knew there was some risk with it, but due to the two paths into Game, I was trying to address an issue.  The current PR is working for all the prior code examples that used to fail.

I have a question, @spydon @munsterlander , why is the lifecycle order of the game : onLoad -> onGameResize ->onMount -> Update -> onRemove  instead of  onMount -> onGameResize ->onLoad  -> Update -> onRemove ?
I feel strange. Isn't onMount first, and then onLoad?
Logically speaking, onLoad can only continue to work after onMount.
Perhaps my idea is wrong.

OnLoad is actually a future, but in Flames case, it's loading things that need to be mounted that then get attached.

OnLoad is actually a future that gets awaited, but in Flames case, it's loading things that need to be mounted that then get attached.
Edit: Here is the code of interest:
https://github.com/flame-engine/flame/blob/d08284ddcaf5d2ad6e5312336a71a113702dc241/packages/flame/lib/src/game/game_widget/game_widget.dart#L191

That's why I have questions. If onMount first and then onLoad, the required things at that time are actually already mounted.
I have a situation now,
mixin ListenerHandler on Component {
  @override
  void onMount() {
    super.onMount();
    // add listener
  }

  @override
  void onRemove() {
    super.onRemove();
    // remove listener
  }
}

class MyComponent extends Component with ListenerHandler {
  @override
  FutureOr<void> onLoad() {
    // here, i can not call lister!
    // lister.call();

    return super.onLoad();
  }
}

Do I need to add a listener  in onLoad of the mixin?

why is the lifecycle order of the game : onLoad -> onGameResize ->onMount -> Update -> onRemove instead of onMount -> onGameResize ->onLoad -> Update -> onRemove ?

That is because once a component is mounted it starts ticking (updating + rendering). If we mark it mounted first and then start the async loading, it will be in an uninitialized state for some frame until the loading is complete. Current approach allows for fully loading heavy components much before they are mounted and start updating.

Do I need to add a listener in onLoad of the mixin?

Yes.

I have discovered a potential memory leak, but I am not sure. @munsterlander
Game holds overlays, overlays also holds game.   mutual reference

Although this can still meet my needs, it is not elegant enough for the code.

It's literally the same code just being called a little later in the components lifecycle.
I don't know your full usecase, but the mixin you shared looks quite misleading. It gives the idea that it allows the component to listen to something by registering and unregistering from the listener in onMount and onRemove. But then the component implementation you shared, it itself calls the listener.call while loading. So if the emitter and listener are the same objects, is the invoke and listen even needed?
Overall I'm just saying that there is a possibility that your code needs some redesign instead of Flame's component lifecycle 😅

@MiaoShichang feel free to open up new issues if you think something needs fixing or start a discussion here or on discord to discuss questions and potential problems about Flame. Let's limit the current issue to the original problem.

import 'package:flame/components.dart';
import 'package:flame/game.dart';

typedef EventMessageListener = void Function(EventMessage message);
typedef EventMessageCallBack = void Function(Object? data);

class EventMessage {
  int type = 0;
  Object? data;
  EventMessageCallBack? callback;
  EventMessage({required this.type, this.data, this.callback});
}

class EventMessageManager {
  final List<_EventMessageItem> _msgList = [];
  EventMessageManager();
  void addListener(int msgType, EventMessageListener listener) {
    _EventMessageItem? item = _getByMessageType(msgType);
    if (item == null) {
      item = _EventMessageItem(msgType);
      _msgList.add(item);
    }
    item.add(listener);
  }

  void remove(EventMessageListener listener, {int? msgType}) {
    if (msgType != null) {
      _EventMessageItem? item = _getByMessageType(msgType);
      if (item != null) {
        item.remove(listener);
        if (item.isEmpty()) {
          _msgList.remove(item);
        }
      }
    } else {
      for (var item in _msgList) {
        item.remove(listener);
      }
    }
  }

  void send(EventMessage message) {
    for (var item in _msgList) {
      if (message.type == item.type) {
        item.send(message);
        break;
      }
    }
  }

  _EventMessageItem? _getByMessageType(int msgType) {
    for (var item in _msgList) {
      if (msgType == item.type) {
        return item;
      }
    }
    return null;
  }
}

//
class _EventMessageItem {
  int type = 0;
  final List<EventMessageListener> _listenList = [];
  _EventMessageItem(this.type);

  void send(EventMessage message) {
    for (var l in _listenList) {
      l(message);
    }
  }

  void add(EventMessageListener listener) {
    if (!_listenList.contains(listener)) {
      _listenList.add(listener);
    }
  }

  void remove(EventMessageListener listener) {
    if (_listenList.contains(listener)) {
      _listenList.remove(listener);
    }
  }

  bool isEmpty() {
    return _listenList.isEmpty;
  }
}

//
mixin HasEventMessageCenter on Game {
  EventMessageManager mMessageManager = EventMessageManager();
}

//
mixin HasEventMessageHandler on Component {
  void registerEventMessage(List<int> messageList) {}
  void onEventMessage(EventMessage message) {}

  void sendEventMessage(int msgType, {Object? data, EventMessageCallBack? callBack}) {
    final game = findGame()!;
    if (game is HasEventMessageCenter) {
      game.mMessageManager.send(EventMessage(type: msgType, data: data, callback: callBack));
    }
  }

  @override
  void onMount() {
    super.onMount();
    List<int> messageList = [];
    registerEventMessage(messageList);
    if (messageList.isNotEmpty) {
      final game = findGame()!;
      if (game is HasEventMessageCenter) {
        for (var msgType in messageList) {
          game.mMessageManager.addListener(msgType, onEventMessage);
        }
      }
    }
  }

  @override
  void onRemove() {
    super.onRemove();
    List<int> messageList = [];
    registerEventMessage(messageList);
    if (messageList.isNotEmpty) {
      final game = findGame()!;
      if (game is HasEventMessageCenter) {
        for (var msgType in messageList) {
          game.mMessageManager.remove(onEventMessage, msgType: msgType);
        }
      }
    }
  }
}

this is my code, if the onMount is be called before the onLoad, then i can call sendEventMessage of mixin.
this bug about onRemove be found is that  the game with this mixin not correct working .

import 'package:flame/components.dart';
import 'package:flame/game.dart';

typedef EventMessageListener = void Function(EventMessage message);
typedef EventMessageCallBack = void Function(Object? data);

class EventMessage {
  int type = 0;
  Object? data;
  EventMessageCallBack? callback;
  EventMessage({required this.type, this.data, this.callback});
}

class EventMessageManager {
  final List<_EventMessageItem> _msgList = [];
  EventMessageManager();
  void addListener(int msgType, EventMessageListener listener) {
    _EventMessageItem? item = _getByMessageType(msgType);
    if (item == null) {
      item = _EventMessageItem(msgType);
      _msgList.add(item);
    }
    item.add(listener);
  }

  void remove(EventMessageListener listener, {int? msgType}) {
    if (msgType != null) {
      _EventMessageItem? item = _getByMessageType(msgType);
      if (item != null) {
        item.remove(listener);
        if (item.isEmpty()) {
          _msgList.remove(item);
        }
      }
    } else {
      for (var item in _msgList) {
        item.remove(listener);
      }
    }
  }

  void send(EventMessage message) {
    for (var item in _msgList) {
      if (message.type == item.type) {
        item.send(message);
        break;
      }
    }
  }

  _EventMessageItem? _getByMessageType(int msgType) {
    for (var item in _msgList) {
      if (msgType == item.type) {
        return item;
      }
    }
    return null;
  }
}

//
class _EventMessageItem {
  int type = 0;
  final List<EventMessageListener> _listenList = [];
  _EventMessageItem(this.type);

  void send(EventMessage message) {
    for (var l in _listenList) {
      l(message);
    }
  }

  void add(EventMessageListener listener) {
    if (!_listenList.contains(listener)) {
      _listenList.add(listener);
    }
  }

  void remove(EventMessageListener listener) {
    if (_listenList.contains(listener)) {
      _listenList.remove(listener);
    }
  }

  bool isEmpty() {
    return _listenList.isEmpty;
  }
}

//
mixin HasEventMessageCenter on Game {
  EventMessageManager mMessageManager = EventMessageManager();
}

//
mixin HasEventMessageHandler on Component {
  void registerEventMessage(List<int> messageList) {}
  void onEventMessage(EventMessage message) {}

  void sendEventMessage(int msgType, {Object? data, EventMessageCallBack? callBack}) {
    final game = findGame()!;
    if (game is HasEventMessageCenter) {
      game.mMessageManager.send(EventMessage(type: msgType, data: data, callback: callBack));
    }
  }

  @override
  void onMount() {
    super.onMount();
    List<int> messageList = [];
    registerEventMessage(messageList);
    if (messageList.isNotEmpty) {
      final game = findGame()!;
      if (game is HasEventMessageCenter) {
        for (var msgType in messageList) {
          game.mMessageManager.addListener(msgType, onEventMessage);
        }
      }
    }
  }

  @override
  void onRemove() {
    super.onRemove();
    List<int> messageList = [];
    registerEventMessage(messageList);
    if (messageList.isNotEmpty) {
      final game = findGame()!;
      if (game is HasEventMessageCenter) {
        for (var msgType in messageList) {
          game.mMessageManager.remove(onEventMessage, msgType: msgType);
        }
      }
    }
  }
}

this is my code, if the onMount is be called before the onLoad, then i can call sendEventMessage of mixin in onLoad.
this bug about onRemove be found is that  the game with this mixin not correct working .

Maybe I am completely confused here, but why can't you just flip the events?  Use onload then onmount?  Additionally, you can check isMounted.


9now downloads now failing

Checklist

[x] I'm reporting a broken site support
[x] I've verified that I'm running youtube-dl version 2019.09.01
[x] I've checked that all provided URLs are alive and playable in a browser
[x] I've checked that all URLs and arguments with special characters are properly quoted or escaped
[x] I've searched the bugtracker for similar issues including closed ones

Verbose log

youtube-dl.exe -F "https://www.9now.com.au/pokemon/season-22/episode-29" --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-F', 'https://www.9now.com.au/pokemon/season-22/episode-29', '--verbose']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2019.09.01
[debug] Python version 3.4.4 (CPython) - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg 4.2, ffprobe 4.2
[debug] Proxy map: {}
[debug] Using fake IP <IP_ADDRESS> (AU) as X-Forwarded-For.
[9now.com.au] episode-29: Downloading webpage
ERROR: Unable to extract page data; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -
U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpbzyg5d3a\build\youtube_dl\YoutubeDL.py", line 796, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpbzyg5d3a\build\youtube_dl\extractor\common.py", line 530, in extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpbzyg5d3a\build\youtube_dl\extractor\ninenow.py", line 48, in _real_extract
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpbzyg5d3a\build\youtube_dl\extractor\common.py", line 1005, in _search_regex
youtube_dl.utils.RegexNotFoundError: Unable to extract page data; please report this issue on https://yt-dl.org/bug . Make sure you are using the late
st version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Description

9now used to work (I successfully download on 2019-08-31).
For example on the Pokemon page at: https://www.9now.com.au/pokemon (which has ~4 episodes, adding & dropping 1 each day - so the episode numbers will change over time).
Previously, I had successfully checked what formats were available for Episode 26:
youtube-dl.exe -F "https://www.9now.com.au/pokemon/season-22/episode-26"
And then I normally use the following command to download (based on picking the ~1.5Mbps format)
youtube-dl.exe -f hls-1527-4 --newline -i --write-sub -o "M:\%(uploader)s\s22\e26 %(title)s.%(ext)s" --embed-subs --sub-lang en --ignore-config --hls-prefer-native --add-metadata --write-thumbnail "https://www.9now.com.au/pokemon/season-22/episode-26"
Neither the -F format query, nor the download are working as of today. So something changed/broke between Aug 31st & Sept 11th.

Yes, I'm having the same issue trying to grab the CCs for Seachange no issue with previous weeks.
D:\subs>youtube-dl --verbose https://www.9now.com.au/seachange/season-1/episode-6
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://www.9now.com.au/seachange/season-1/episode-6']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2019.09.01
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
[debug] exe versions: ffmpeg N-87027-gd826951, ffprobe N-87027-gd826951
[debug] Proxy map: {}
[debug] Using fake IP <IP_ADDRESS> (AU) as X-Forwarded-For.
[9now.com.au] episode-6: Downloading webpage
ERROR: Unable to extract page data; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpbzyg5d3a\build\youtube_dl\YoutubeDL.py", line 796, in extract_info
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpbzyg5d3a\build\youtube_dl\extractor\common.py", line 530, in extract
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpbzyg5d3a\build\youtube_dl\extractor\ninenow.py", line 48, in _real_extract
File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpbzyg5d3a\build\youtube_dl\extractor\common.py", line 1005, in _search_regex
youtube_dl.utils.RegexNotFoundError: Unable to extract page data; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
D:\subs>[debug] System config: []
'[debug]' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>[debug] User config: []
'[debug]' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>[debug] Custom config: []
'[debug]' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>[debug] Command-line args: ['--verbose', 'https://www.9now.com.au/seachange/season-1/episode-6']
'[debug]' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
'[debug]' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>[debug] youtube-dl version 2019.09.01
'[debug]' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.18362
'[debug]' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>[debug] exe versions: ffmpeg N-87027-gd826951, ffprobe N-87027-gd826951
'[debug]' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>[debug] Proxy map: {}
'[debug]' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>[debug] Using fake IP <IP_ADDRESS> (AU) as X-Forwarded-For.
'[debug]' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>[9now.com.au] episode-6: Downloading webpage
'[9now.com.au]' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>ERROR: Unable to extract page data; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
'ERROR:' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>Traceback (most recent call last):
'Traceback' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpbzyg5d3a\build\youtube_dl\YoutubeDL.py", line 796, in extract_info
'File' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpbzyg5d3a\build\youtube_dl\extractor\common.py", line 530, in extract
'File' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpbzyg5d3a\build\youtube_dl\extractor\ninenow.py", line 48, in _real_extract
'File' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpbzyg5d3a\build\youtube_dl\extractor\common.py", line 1005, in _search_regex
'File' is not recognized as an internal or external command,
operable program or batch file.
D:\subs>youtube-dl --skip-download --all-subs https://www.9now.com.au/seachange/season-1/episode-6
[9now.com.au] episode-6: Downloading webpage
ERROR: Unable to extract page data; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Me three,
Same error message for https://www.9now.com.au/nate-is-late/season-1/episode-14
Looks like a site-wide issue.


Retrieve w/ code-valued expression errors if list-promotion is disabled

If list promotion is disabled, retrieves with a code-valued terminology target cannot resolve the membership operator:
code "Emergency department patient visit (procedure)": '4525004' from "SNOMEDCT:2016-09" display 'Emergency department patient visit (procedure)'

define "ED Visit": ["Encounter, Performed": "Emergency department patient visit (procedure)"]ED
  with ["Encounter, Order": "Decision to Admit to Hospital Inpatient"] Order
    such that Order.authorDatetime during ED.relevantPeriod

Addressed in v1.2.12-SNAPSHOT.


Replace python cond with tf.cond in CRF functions

Fixes #694

[x] crf_sequence_score
[x] crf_multitag_sequence_score
[x] crf_log_norm
[x] crf_decode
[x] Tests for crf_decode

Botched this PR with a git rebase. Created another clean PR.


Enable parallel recordings

Current State
It's not possible to record parallel in different browsers at the same time, because the websocket port ist hardcoded. As mentioned here https://github.com/SamuelScheit/puppeteer-stream/issues/133, https://github.com/SamuelScheit/puppeteer-stream/issues/139 and https://github.com/SamuelScheit/puppeteer-stream/issues/141
The Fix
The websocket server is created on port 55200, if the port is already in use, it tries opening it on port+1
To communicate the port information to the extension which needs this information for it's websocket client, the options page get's opened by PuppeteerStream with the port information as url hash, instead of opening the options page by the extension itself
How to test in debugging

Create a new node project
Install puppeteer-stream: npm i puppeteer-stream
Create index.js file and set the content to

const { launch, getStream } = require("puppeteer-stream");
const fs = require("fs");

(async () => {
    const browser = await launch({
        executablePath: "C:/Program Files/Google/Chrome/Application/chrome.exe",
    });
    const page = await browser.newPage();
    await page.goto("https://www.youtube.com/watch?v=dQw4w9WgXcQ");
    const stream = await getStream(page, { audio: true, video: true });

    const file = fs.createWriteStream(__dirname + "/" + parseInt(Math.random() * 100) + ".webm");
    stream.pipe(file);

    await new Promise(r => setTimeout(r, 10000));
    await stream.destroy();
    file.close();
    await browser.close();
})();

Clone this pull request into parent folder
Install dependencies npm i --save-dev
Run npm run build
Replace this files with the according onces in the node_modules/puppeteer-stream folder of the step 1 project

dist/PuppeteerStream.js
extension/manifest.json
extension/options.js

When done everything right, you should have a runnable node project but with the replaced files from this pull request
Open two command lines, navigate to step 1 project and execute parallel node index.js
Confirm two .webm files has been created

Thank you very much for your contribution. From what I've seen it looks good. I'll test it

I've tested and everything works as expected, I've merged and published a new version:
npm i<EMAIL_ADDRESS>

That was quick, didn't expect that. Thank you so much.
You can also close https://github.com/SamuelScheit/puppeteer-stream/issues/133, https://github.com/SamuelScheit/puppeteer-stream/issues/139 and https://github.com/SamuelScheit/puppeteer-stream/issues/141 now

Is it possible to recording multiple videos in parallel from a single browser? e.g. using something like puppeteer-cluster.
Example: https://gist.github.com/pirate/9553004f99c0862689386d6c054f5cc7

This is what you are looking for
https://github.com/SamuelScheit/puppeteer-stream/issues/109
https://github.com/SamuelScheit/puppeteer-stream/issues/70
https://github.com/SamuelScheit/puppeteer-stream/issues/67


uses $timeout to wait for page to render completly

Fixes problem reported in benjamincharity/angular-flickity#38

Thanks for the fix @tiriana!


SSR Support

Currently this package doesn't seem to support SSR because of it's use of document
Not that important but it would be nice to have
I'm using SvelteKit

Thanks for the bug report. This is introduced in v0.8 - FWIW it's supposed to work since document is only used in onMount() and should only run client-side... but I think I know what's wrong. I'll submit a fix soon.

@iluvsoup - I published a fix in the @next tag. Could you help test and see if the error shows again? 🙏
You can install with:
$ npm i @zerodevx/svelte-toast@next

Works great other than a visual bug whenever I refresh the page
https://user-images.githubusercontent.com/94307595/199830425-97c7df58-4330-4fb4-86c4-3e9c3f9c9faf.mp4
It happens on both chrome and firefox, could it be a svelte quirk?
Thanks for the quick reply by the way

On second thought it might be an issue with my form submission, I'll look in to it

Actually it might be something to do with the stores not clearing on refresh, the toasts don't ever seem to go away

(the outputs of console.log($toasts))

Wow, not sure what's going on to be honest. Is the error message gone? Also, could you try installing:
$ npm i<EMAIL_ADDRESS>
and let me know if anything changed?

Oh yeah the error message is gone, it's just the store don't seem to clear whenever I refresh which results in the giant wall of toasts

Does this still happen with v0.7.2? Just wanna isolate.

Yes

Ah ok, I'm pretty sure we're facing 2 separate issues here. The document is not defined thing happens because while onMount() to guaranteed to only run client-side, it appears onDestroy() may be called during SSR - this will be fixed with #57.
On the other hand, the wall of toasts thing is likely related to your form submission code. If you can post a minimal reproduction, perhaps we can move this to a new issue and try to work it out from there.
For now, I'll publish a patch release which should mark this SSR issue as fixed.


:test_tube: Adding new e2e test, for registry type (#1012)

Signed-off-by: Matthias Wessendorf<EMAIL_ADDRESS>

OCF Webhook is merging this PR


Need to clean the default parsers in cache directory after modified grammar

I modified the grammar, you need to clean the default parsers in cache directory.
Originally posted by @pressureless in https://github.com/pressureless/linear_algebra/issues/21#issuecomment-720127057

A couple of possible solutions:

The hash in the filename could be a hash of the entire contents of the grammar files as a string.
When loading a grammar, always check the file modification times before accepting the cached version.

App user on Mac(with release version) should have no trouble now since I compare the timestamps and remove the old parsers from cache directory.
But developer still has the problem if the grammar is modified but the parsers under la_local_parsers are not updated. One naive way would be every time when I modify the grammar, I update the new parsers and push them. But there's no need to push parsers frequently.
I didn't use the entire content for hash value since I thought the content may be too long.

That's good. So when you update the grammar, everything is fine if you run the la_local_parsers.py script before you push, right?
My guess is that the entire content won't be too long. You could even hash each grammar file separately, concatenate the hashes, and then has that. git takes hashes of the entire contents of every file. It's fast, even though it's written in shell scripts.

On Nov 2, 2020, at 11:39 PM, pressureless<EMAIL_ADDRESS>wrote:
App user on Mac(with release version) should have no trouble now since I compare the timestamps and remove the old parsers from cache directory.
But developer still has the problem if the grammar is modified but the parsers under la_local_parsers are not updated. One naive way would be every time when I modify the grammar, I update the new parsers and push them. But there's no need to push parsers frequently.
I didn't use the entire content for hash value since I thought the content may be too long.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/pressureless/linear_algebra/issues/24#issuecomment-720900569, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACC7XQMQLBBMT53XF5Z7DTSN6CP5ANCNFSM4THG6A3A.

Yes, la_local_parsers.py can still generate new parsers.
OK. I'll try that later.


Improve docs SEO

This is HubSpot's SEO review of the install page:

@jess-edwards

@jseldess
The page DOES have a HubSpot Call-to-Action on it - the email field step that appears as the final step - so disregard that warning.
Here are some best practices for writing meta descriptions:
How to Write Great Meta Descriptions
Effective meta descriptions drive someone to click when they see your page appear in search results. Persuade the searcher to click while still maintaining accuracy so expectations are met.

Use action-oriented language.
Action-oriented language: Consider starting your meta descriptions with verbs like "Learn" or "Discover," and follow it up with specifics of what exactly they'll get if they click.

Provide a solution or benefit.
Write a short sentence previewing the content or telling the searcher why they should read your post. This is your chance to sell them on what you have to offer -- informative, valuable content.

Keep it under 155 characters.
[in Google Docs: shift+CMD+C  = WordCount]
Google actually doesn't measure by characters -- it measures by pixels -- but 155 characters is a  benchmark.

Make it specific and relevant.
Use descriptive words -- not unnecessary "fluff" words -- and do your best to connect with your target audience and let them know what they'll get from clicking through on your search result.


[Bug] Can we get the coordinates when we know the datalabel and series data point?

Version
5.3.0
Link to Minimal Reproduction
https://echarts.apache.org/examples/en/editor.html?c=line-simple
Steps to Reproduce

Create any chart.
I want to click on series datalabel or axis data label.
when I clicked on that particular area of the chart. Do, I get the co-ordinates from the chart instance?

Current Behavior
Need the co-ordinates of the particular area in the chart
Expected Behavior
Need the co-ordinates of the particular area in the chart
Environment
- OS:
- Browser:
- Framework:

Any additional comments?
No response

Maybe you can try this
option = {
  xAxis: {
    type: 'category',

    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      data: [150, 230, 224, 218, 135, 147, 260],
      type: 'line',
      emphasis:{
        label:{
          show:true
        }
      }
    },
  ]
};

Do you mean you want to get series points' coordinates in DOM, not data?

@jiawulin001  x, y position

https://echarts.apache.org/en/api.html#echartsInstance.convertToPixel See if this helps.


Enable doc_auto_cfg on docs.rs builds

This flag includes #[cfg] bounds in the generated documentation.
For example, the docs for the x86_64::structures::paging::mapper module now look like this:

We see that OffsetPageTable is now annotated with 64-bit because the module has #![cfg(target_pointer_width = "64")]. Similarly, the RecursivePageTable struct is now annotated with instructions because it is #[cfg(feature = "instructions")].

What's the relationship between doc_cfg and doc_auto_cfg? The nightly features enables the doc_cfg feature, should it also enable doc_auto_cfg?
Overall I really like this change.

The failing CI check is unrelated to this pr, though we should take a look at it nonetheless.

What's the relationship between doc_cfg and doc_auto_cfg?

See https://doc.rust-lang.org/rustdoc/unstable-features.html#doccfg-recording-what-platforms-or-features-are-required-for-code-to-be-present. The doc_cfg feature allows the same thing, but through manual annotations. Looks like we used in the past for annotating nightly-only macros that require inline assembly: https://github.com/rust-osdev/x86_64/commit/17ca2b07cdee30daf9ea4c5c7d271f2cb998b00b. Now that inline assembly is stable, we don't use that feature anymore, so I think we can remove it.

The nightly features enables the doc_cfg feature, should it also enable doc_auto_cfg?

It does make the generated docs nicer, but it increases the chance of nightly breakage. Given that cargo doc automatically resolves cfg flags when building the documentation of dependencies, the value for users of this crate would be limited. So I think it's better to keep it disabled by default.

I opened https://github.com/rust-osdev/x86_64/pull/408 to remove the doc_cfg feature.


HIVE-13353: SHOW COMPACTIONS should support filtering options

What changes were proposed in this pull request?
https://issues.apache.org/jira/browse/HIVE-13353
Since we now have historical information in SHOW COMPACTIONS the output can easily become unwieldy. (e.g. 1000 partitions with 3 lines of history each)
this is a significant usability issue
Need to add ability to filter by db/table/partition
Perhaps would also be useful to filter by status
Why are the changes needed?
We are now giving flexibility to filter compactions on db,table,partition,type state etc.
Does this PR introduce any user-facing change?
no
How was this patch tested?
junit

The changes are not reflected in the SHOW COMPACTIONS command itself.
You need to add the possiblity to supply the new filter criteria through SHOW COMPACTIONS, otherwise the new filters will never be used.

Please check:
org/apache/hadoop/hive/ql/ddl/table/storage/compact/AlterTableCompactOperation.java:130


Rewrite SpiderFuncs and spider_map to operate on SpiderLeg

Abandoned spider leg in favor of fewer types. Now using Vector{Vector{ComplexF64}}


Fix NPE issue during client creation

Fix NPE issue during client creation

API change check
API changes are not detected in this pull request.


A bit of cleanup and reformatting

Adding some pretty minor tweaks to make things a tad bit neater/easier to understand. Found a typo or two as well.

LGTM too! I'm not super wild about the subheading titles in the "How will this policy affect me?" section, because I like symmetry and they are a mixture of questions and statements, but there's nothing actually wrong with them. The course as a whole is pretty darn good. On to external reviewers!

Yes this also kind of bothers me haha. I can take a stab at cleaning them up.

I fixed those spelling errors in my PR @avahoffman if we decide we want to merge that one.

Merging now, since this has already gotten kinda big.


Add debug log output

I just added debug output and now it... works?

This one worked because the source branch of this PR is from this repo. The other one didn't work because that PR had the source branch from a fork of this repo.
GitHub doesn't share the secrets across forks for security reasons. That's also why the user/credentials were missing and thus resulting in the failed action run.
See: https://docs.github.com/en/actions/security-guides/encrypted-secrets#using-encrypted-secrets-in-a-workflow

Note: With the exception of GITHUB_TOKEN, secrets are not passed to the runner when a workflow is triggered from a forked repository.


Spinner doesn't working fine when calling "show" method next time

Spinner doesn't working fine when I want to show it next time..
Can someone helping me please?

You should be more specific in your answer. Your problem is unclear.

I have seen this problem too @jessalbarian
I use SwiftSpinner with RxSwift (through a code pattern called ActivityIndicator), and out side of it, and when I do:
SwiftSpinner.show(<text 1>, animate: true)
then
SwiftSpinner.hide()
then immediately
SwiftSpinner.show(<text 2>, animate: true)
The second spinner will not appear.

Have you tried it without the hide?

Yes. It works properly with a hide() called between the two show() method calls.
That is not a good solution for me however. If I have two separate network calls, independent of each other, and non-deterministically sequenced, I need to sandwich each call with a pair of show/hide somehow.

You could try showing/hiding SwiftSpinner.sharedInstancedirectly, but I haven't tried that before not sure if it's a brilliant idea ... though, if it works in your case - why not :)

I'm facing the same issue (hide between two show, the last show doesn't work)
@icanzilb what do you mean by "showing/hiding SwiftSpinner.sharedInstance directly" ?

Hey @sam199488
I reckon this issue should be fixed by one of the latest PR (#122).
Can you test against the master version of the lib?


💬 [Question] Smoothen the Github Workflow

💬 Question
Our Github testing workflow is triggered by pushes.
Every time all builds, lintings and test are executed.
Can we manage do differentiate  by areas of change to save time and resources?

if the commits of a push only relate to a certain area / directory of the repo (e.g. just some frontend changes), only builds, linting and tests regarding this area are required this seems to be implementable in Github Workflow)

This is covered by #2664.


better document the code for crying out loud

cleaned up the code a bit and added better comments and docstrings


travis integration tests

Even thought https://github.com/travis-ci/apt-package-whitelist/issues/783 has been merged I'm still not seeing gpg2 in travis containers. Need to keep digging around I guess.

Added in https://github.com/Autodesk/cryptorito/pull/6 ✨


CLI for getting JSON?

I think it might be handy to have a CLI for getting as_json(). This would be useful to quickly get info from a PEP 621 project without having to trigger more expensive processes. This is not a universal solution to https://github.com/pypa/build/issues/579, but it would be very fast when it works.

I think that this could be useful, but it could also give the false impression that it is possible to extract information from a package without running the build backend. In the case of meson-python, for example, this pyproject.toml is perfectly fine to generate a valid and complete Python wheel:
[build-system]
build-backend = 'mesonpy'
requires = ['meson-python']

meson-python in this case derives the wheel name and version (and soon also license) from meson.build. However, the tool proposed here could only report that the pyproject.toml is invalid as it does not contain a project table. Note that this feature of meson-python is defined in PEP 621 and it is not a funky extension.

If a "only read PEP 621 metadata" CLI was acceptable anywhere, it would be here, though - unlike something like build, this package is focused only on reading PyProject Metadata.
A file that doesn't use PEP 621 would just produce an error stating there is no metadata to read. Ideally with a unique error code so a pipeline could then do a more expensive read.

A file that doesn't use PEP 621 would just produce an error stating there is no metadata to read. Ideally with a unique error code so a pipeline could then do a more expensive read.

Build backends can allow any field in the project table to be dynamic. How is this tool going to signal that a specific field is dynamic? The consumer of the data would need to first check whether the fileds it is interested into are declared as dynamic. This requires enough logic that however it is implemented, I don't think consuming JSON or TOML makes much of a difference. If it makes a difference, there are several toml2json implementations that can be used to convert TOML into JSON.

It's not just the conversion, it's also the fact we do things like load README, license files, etc. Though yes, handling project.dynamic is tricky, though I guess we could misuse Dynamic (along with the fact that version can't be Dynamic, so if it's missing, it's project.dynamic). We could also set these to null, since JSON (unlike TOML) does have that concept. But yes, maybe it's limited and not straight forward enough to do.


Positional audio

The positional sound example has no positional audio. The audio should be played in left and right ears, corresponding to robot position compared to camera. At the moment the audio is normal, without 3D effect.
https://playcanvas.vercel.app/#/sound/positional

agreed. Tested against example from main_v1 and the situation is the same there, which means broken for months now.

This might not be an engine issue.
Checking the article here: https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialization_basics
There are some examples given, using three:
https://mdn.github.io/webaudio-examples/spatialization/
https://mdn.github.io/webaudio-examples/stereo-panner-node/
They don't seem to work either for me. Web Audio issue?

Linking https://github.com/WebAudio/web-audio-api/issues/2609

Using Chrome on macOS, on the MDN boombox example:

I have correct stereo panning if I only move the boombox left and right. It seems like it's in a 2D mode.
If I change the height (up and down), there is a noticeable switch into "spatial" mode. The sound is quieter but more obviously spatialized. Stereo panning continues to work, but now it sounds more natural/realistic.
If I change the depth (in and out) or rotation, there is another switch. Now stereo is broken. If I bring the depth back to the default and move left and right, there is no stereo panning.

This seems to be fixed now in browser. The robot example could be improved to make the positional sound changing ears more prominent, but it is working atm. Closing.


Automatically prepends '20' to start of year

So while using the year mask, if you type any number other than 1 of 2, it will automatically prepend '20'.  So if you type, say 3, it will show mm/dd/203y.
Is there a way to customize so that this does not occur and it just uses whatever number you type?

The business on my project are asking the same, or they'd like to default to 19 rather than 20 for birthdates.  Is there a way to configure this?


.Net: Azure CosmosDB Mongo vCore Memory Store Integration

Motivation and Context (Why the change? What's the scenario?)
I have added Azure Cosmos DB Mongo vCore as Memory to be used by customers using Kernel Memory and Cosmos DB for their LLM applications.
https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/vcore/vector-search

Python Test Coverage Report • FileStmtsMissCoverMissingTOTAL4850102079% report-only-changed-files is enabled. No files were changed during this commit :)
Python Unit Test Overview

Tests
Skipped
Failures
Errors
Time

990
11 :zzz:
0 :x:
0 :fire:
16.080s :stopwatch:

Python Test Coverage Report • FileStmtsMissCoverMissingTOTAL4850102079% report-only-changed-files is enabled. No files were changed during this commit :)
Python Unit Test Overview

Tests
Skipped
Failures
Errors
Time

990
11 :zzz:
0 :x:
0 :fire:
17.202s :stopwatch:

Python 3.9 Test Coverage Report • FileStmtsMissCoverMissingTOTAL494292081% report-only-changed-files is enabled. No files were changed during this commit :)
Python 3.9 Unit Test Overview

Tests
Skipped
Failures
Errors
Time

1026
2 :zzz:
0 :x:
0 :fire:
23.691s :stopwatch:

Python 3.10 Test Coverage Report • FileStmtsMissCoverMissingTOTAL494891981% report-only-changed-files is enabled. No files were changed during this commit :)
Python 3.10 Unit Test Overview

Tests
Skipped
Failures
Errors
Time

1026
1 :zzz:
0 :x:
0 :fire:
20.818s :stopwatch:

Python 3.8 Test Coverage Report • FileStmtsMissCoverMissingTOTAL480592781% report-only-changed-files is enabled. No files were changed during this commit :)
Python 3.8 Unit Test Overview

Tests
Skipped
Failures
Errors
Time

1026
11 :zzz:
0 :x:
0 :fire:
18.222s :stopwatch:

Python 3.11 Test Coverage Report • FileStmtsMissCoverMissingTOTAL494891981% report-only-changed-files is enabled. No files were changed during this commit :)
Python 3.11 Unit Test Overview

Tests
Skipped
Failures
Errors
Time

1026
1 :zzz:
0 :x:
0 :fire:
23.305s :stopwatch:

@aayush3011 can you run dotnet format from the dotnet folder to fix the formatting issues

@dmytrostruk , I have resolved your comments. Can we move forward with merging this PR?

@dmytrostruk , I have resolved your comments. Can we move forward with merging this PR?

@aayush3011 I approved with a couple of small comments. Thanks.

Looks like there is a problem with OpenAI/Azure Open AI endpoints. Integration tests are failing in both .NET and Python versions randomly. Let's wait a little bit and try to merge it again when endpoints become more reliable.

@dmytrostruk , is someone looking at these Python test failures?

@dmytrostruk , is someone looking at these Python test failures?

@aayush3011 Yes, active PR is here: https://github.com/microsoft/semantic-kernel/pull/5983


Postgres 12->13 upgrade fail due to function not present in binary

Bumped into three issues during upgrade. Might be my dev builds, might be more serious leftovers of functions that are pointing to nowhere in binaries.
pg_restore: from TOC entry 2374; 1255 18901 FUNCTION h3_get_h3_unidirectional_edge_boundary("public"."h3index") gis
pg_restore: error: could not execute query: ERROR:  could not find function "h3_get_unidirectional_edge_boundary" in file "/usr/lib/postgresql/13/lib/h3.so"
Command was: CREATE FUNCTION "public"."h3_get_h3_unidirectional_edge_boundary"("edge" "public"."h3index") RETURNS "polygon"
    LANGUAGE "c" IMMUTABLE STRICT PARALLEL SAFE
    AS 'h3', 'h3_get_unidirectional_edge_boundary';

...

pg_restore: from TOC entry 2023; 1255 18919 FUNCTION h3_set_to_multi_polygon("public"."h3index"[]) gis
pg_restore: error: could not execute query: ERROR:  could not find function "h3_set_to_linked_geo" in file "/usr/lib/postgresql/13/lib/h3.so"
Command was: CREATE FUNCTION "public"."h3_set_to_multi_polygon"("public"."h3index"[], OUT "exterior" "polygon", OUT "holes" "polygon"[]) RETURNS SETOF "record"
    LANGUAGE "c" IMMUTABLE STRICT PARALLEL SAFE
    AS 'h3', 'h3_set_to_linked_geo';

....

pg_restore: creating INDEX "public.covid19_population_h3_r6_h3_idx"
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 6963; 1259<PHONE_NUMBER> INDEX covid19_population_h3_r6_h3_idx gis
pg_restore: error: could not execute query: ERROR:  type "geometry" does not exist
LINE 1:  SELECT ST_SetSRID(h3_to_geo($1)::geometry, 4326)
                                          ^
QUERY:   SELECT ST_SetSRID(h3_to_geo($1)::geometry, 4326)
CONTEXT:  SQL function "h3_to_geometry" during inlining
Command was:
-- For binary upgrade, must preserve pg_class oids
SELECT pg_catalog.binary_upgrade_set_next_index_pg_class_oid('3204505732'::pg_catalog.oid);

CREATE INDEX "covid19_population_h3_r6_h3_idx" ON "public"."covid19_population_h3_r6" USING "gist" ((("h3")::"public"."geometry"));

Other notes: https://gist.github.com/Komzpa/994d5aaf340067ccec0e#gistcomment-3485388

Hm, these are all functions that have been renamed at various points. For example (in h3--3.4.1--3.5.0.sql):
ALTER FUNCTION h3_get_unidirectional_edge_boundary(h3index) RENAME TO h3_get_h3_unidirectional_edge_boundary;

But it is still pointing to the wrong function.
Could this be because I'm omitting link_symbol when creating functions (CREATE FUNCTION ... AS 'h3' and not CREATE FUNCTION ... AS 'h3', 'h3_get_etc'), and when renaming the assumed function name is kept and not updated along with the function name?
What extension version are you on?

As far as I can tell the functions are changing link symbol during updates, which we are testing using the ci-install tests (link_symbols are in the prosrc column).
@Komzpa did you figure out whether this was only your dev builds? Otherwise can you help me reproduce this?


merge package template from Kronos-Tools/npm-package-template

Updated standard to latest version

Codecov Report

Merging #251 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #251   +/-   ##
=======================================
  Coverage   88.42%   88.42%
=======================================
  Files           1        1
  Lines         216      216
=======================================
  Hits          191      191
  Misses         25       25

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 c81b0fc...289577b. Read the comment docs.


User material-ui component for unordered list

@cryos: "If you look at App.tsx, the unordered list there, I had been meaning to make that into a component that can be reused on multiple pages, and to use the Material-UI list component instead of the default ul, li etc, i.e. https://material-ui.com/components/lists/"

Thanks for improving the list, as we discussed there is more to be done and the queue component will be a central component of the application.


adding ALPACA docs

Can you edit the ALPACA.py as well to point out to the the online tutorial. This section
https://github.com/SlicerMorph/SlicerMorph/blob/1bbfd33e531d61e0e21d1ec70ecc2f30d43f8096/ALPACA/ALPACA.py#L29-L40

Do you mean adding that there is an online tutorial at 'https://github.com/SlicerMorph/S_2020/tree/master/Lab_ALPACA' on the self.parent.helpText section?

Yes, and also comment the defaultHelpLink function (or whatever it is called) that points out to wiki

I will close this one and submit another.


fix/moduleName

"VirtualMachineHandler/helpers" how does this map to our repository?

new go modules support dynamic module resolution, see first line of go.mod


features: mountExtensions: how best to represent feature support for idmap?

I don't think a boolean is sufficient to describe the state of idmapped mount support.

At the moment, runc only supports this for one specific case (which will be fixed by opencontainers/runc#3985). Once we fix this, runc will only support these flags for bind mounts. However, the specification allows you to set these fields for any mount, which runc doesn't currently support (because it would require reworking a lot of our mount infrastructure). crun also only supports idmappings for bind-mounts at the moment, and youki doesn't yet support idmappings.

I don't know if there is a nice way to describe all of these cases. You could have a string saying which filesystem types are supported, but bind-mounts are not treated as a filesystem type by the spec... We can probably ignore the way runc currently supports idmapped mounts because I suspect nobody is going to release a runtime with the feature  that is that restricted.

Originally posted by @cyphar in https://github.com/opencontainers/runtime-spec/pull/1219#discussion_r1301188855

Maybe this could be an object like:
"mountExtensions": {
  "idmap": {
    "modes": ["sameAsUserns", "arbitrary"],
    "filesystemTypes": ["ext4", "tmpfs", "foobarfs"],
    "supportsBind": true
  }
}

wdyt?
Also we need to figure out how to deal with recursive mounts -- see #1216. If we add a separate flag for this, we will need to add an entry to this struct.

Originally posted by @cyphar in https://github.com/opencontainers/runtime-spec/pull/1219#discussion_r1301251621

I think having a list of supported (or explicitly unsupported) filesystems would be a good idea. Now that I think about it, since runc will not release a version with restricted mapping support, it's probably not necessary to have a field for whether we support arbitrary mappings or not. I think it's fair to say the spec implies arbitrary mapping support is a requirement.

besides I don't know how you plan to detect idmap mount support at runtime

That isn't my proposal -- the plan is to provide a list of filesystems that may work (or we can do it your way -- make a list that definitely don't work). If we want to return a list of filesystems that are definitely not supported (your suggestion), it will be necessary to copy the output of /proc/filesystems for container runtimes that only support bind-mounts (which is currently all OCI runtimes that support is mappings).

@cyphar

That isn't my proposal -- the plan is to provide a list of filesystems that may work

Then it won't remove the trial and error that was your use case.

If we want to return a list of filesystems that are definitely not supported (your suggestion)

I think that is cleaner, but I don't see any real use case for any of this.
The only thing I can think of is, if k8s wants to enable userns by default (I'd love to do that), it might be useful to know which things won't work. But not even in this case, as k8s only sets bind-mounts (and I don't think that will change soon), so this is probably not needed in that case either.

it will be necessary to copy the output of /proc/filesystems for container runtimes that only support bind-mounts

Hmm, why? I don't see it at all why this won't be just a list of fs we need to change the infrastructure to support idmapping them. Why would we parse that?

(which is currently all OCI runtimes that support is mappings).

crun in git now supports regular mounts too.


Build of retdec-config fails with "undefined reference to Json::Value"

I compile the Retdec source code. Error from compiling was showed an error as below.
[ 32%] Linking CXX executable retdec-config
../retdec-config/libretdec-config.a(architecture.cpp.o): In function `retdec_config::Architecture::getJsonValue() const':
architecture.cpp:(.text+0x4cd): undefined reference to `Json::Value::Value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
architecture.cpp:(.text+0x4da): undefined reference to `Json::Value::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
architecture.cpp:(.text+0x521): undefined reference to `Json::Value::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
architecture.cpp:(.text+0x5ce): undefined reference to `Json::Value::Value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
architecture.cpp:(.text+0x5db): undefined reference to `Json::Value::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
architecture.cpp:(.text+0x616): undefined reference to `Json::Value::Value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
architecture.cpp:(.text+0x623): undefined reference to `Json::Value::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

I check command line generate an error result again with  $make VERBOSE=1. Error present as below.
cd /retdec/build/deps/fileformat/deps/retdec-config/src/retdec-configtool && cmake -E cmake_link_script CMakeFiles/retdec-configtool.dir/link.txt --verbose=1
/usr/local/bin/c++  -O3 -DNDEBUG   CMakeFiles/retdec-configtool.dir/retdec-configtool.cpp.o  -o retdec-config -Wl,-rpath,:::::::::::::: ../retdec-config/libretdec-config.a ../../../../../capstone2llvmir/deps/tl-cpputils/src/tl-cpputils/libtl-cpputils.a ../../../../../fnc-patterns/deps/fileformat/deps/retdec-config/deps/jsoncpp/jsoncpp-project-prefix/src/jsoncpp-project-build/src/lib_json/libjsoncpp.a /usr/local/lib64/libjsoncpp.a
../retdec-config/libretdec-config.a(architecture.cpp.o): In function `retdec_config::Architecture::getJsonValue() const':
architecture.cpp:(.text+0x4cd): undefined reference to `Json::Value::Value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

Cross check library path of Jsoncpp library install in /usr/local/lib64/ completed.

Hi. Can you please provide the following details so we can investigate this further?

What Linux distribution and version do you use?
What CMake version do you use?
What was the cmake command that you used before make?
What compiler and version did you use for build?
From what you have written, I assume that you have jsoncpp installed in your system. Correct?

Source code build on Linux-AWS-AMI
Cmake version 3.10.1
Yes, I was run Cmake before use a Make command line.
GCC version 5.3.0
That path to install the Jsoncpp files are /usr/local/lib64/.  Path file contain library such as libjsoncpp.so.1.8.3 , libjsoncpp.so, libjsoncpp.so.a. Library and include files of the Jsoncpp compiled from source code.

I think should close that issues because found the way to built step completed. The root cause $make -j4 command line  instead of $make as manual suggested.

There is no need to close as make -j4 is valid. From the output that you provided, it seems that jsoncpp is linked twice on your system when building retdec-config:
/usr/local/bin/c++ [..] retdec-configtool.cpp.o [..]
    jsoncpp/jsoncpp-project-prefix/[..]/lib_json/libjsoncpp.a /usr/local/lib64/libjsoncpp.a

First, there is our version, and then the system version, which should not be linked. What is strange is that I also have jsoncpp installed in my system, but it links fine (i.e. just once, our version).
We will investigate this.

I also run into these undefined references using on my Linux boxes.
One runs redhat, the other funtoo.
The build compilers are gcc 7.2. cmake is at version 3.10 (also tried with 3.9.3).
Build was attempted with simple 'make' after 'cmake' as well as 'cmake --build .'

@pro-spero Thank you for the confirmation. May I ask if you have JsonCpp installed in your system on these boxes? I am trying to reproduce this issue, but no success so far.

On the redhat machine the libraries are installed, but the headers are not present.
The funtoo machine has both headers and the binaries.

Piping the build outputs to a log file and checking the details I found that the dependent projects do not all use the same compiler (7.2) as the top level one, e.g., llvm itself selected the system compiler on redhat, which is 4.8.5. Such mixing will not work. I will attempt to get a more consistent use of compilers.

That's a good point. We will need to properly propagate the compiler selected in the top-level project to all the external projects (e.g. jsoncpp).

It is not sufficient to have the compiler in the path to be picked up, but setting the CC and CXX variables before calling the top level cmake for configuration apparently allows to avoid the problem of undefined references.

I have improved the build of retdec-config and jsoncpp so that they both use the same compiler. Could you please try to build the current master branch of the retdec repository (without any need to set any CC or CXX variables) to verify whether this fixed to build for you?

I can confirm that I can now build successfully without special settings to the environment. I successfully compiled the master branch at revision 74ae5a52da4a9d0fa7f313bceb8cdde2cafcd900.

Perfect, thank you for the confirmation! I am closing the issue, but if anyone still has these jsoncpp-related problems, let us know.


CMSIS v2 osThreadJoin does not work if thread exits with osThreadExit

Describe the bug
Joining a CMSIS v2 thread that exited with osThreadExit returns osErrorResource. The join itself actually waits for the thread to exit, however has_joined is only set in zephyr_thread_wrapper and osThreadExit terminates the thread with k_thread_abort. Joining works, if the thread exits with a return, however this is counter to the RTOS v2 documentation and not allowed on other operating systems. Fix would seem to be to also set the has_joined in osThreadExit.
Expected behavior
According to RTOS v2 documentation: The function osThreadExit terminates the calling thread. This allows the thread to be synchronized with osThreadJoin.

this shouldn't be hard to fix once #23028 goes in

Spent some time looking at this. Integrating k_thread_join() into this scheme has issues due to Zephyr not having any concept of "detached" threads.
I'm using the following as a reference https://www.keil.com/pack/doc/CMSIS/RTOS2/html/group__CMSIS__RTOS__ThreadMgmt.html
About k_thread_join(): If some thread A calls osThreadJoin() on a joinable thread B, and while A is waiting, B calls osThreadDetach() on itself. The current behavior in Zephyr's CMSISv2 implementation is for osThreadJoin() called by A to return with osErrorResource. I think this is correct as the spec for osThreadJoin() documents its return values "osErrorResource: the thread is in an invalid state (ex: not joinable)." But if we use Zephyr's k_thread_join() implementation, I don't see a good way to wake up the caller early if the target thread detaches, since the OS itself doesn't know anything about CMSIS detached threads.
Now, it's not un-heard of for specific CMSIS implementations to have caveats. For example, FreeRTOS documents https://arm-software.github.io/CMSIS-FreeRTOS/General/html/tech_data.html. We could consider doing the same for Zephyr and just say that if you are blocked joining on a thread, and the thread detaches, the join operation will continue until that thread detaches.
Something else I noticed. In the spec, it says "The function osThreadJoin waits for the thread specified by thread_id to terminate. If that thread has already terminated, then osThreadJoin returns immediately." But there's a check _is_thread_cmsis_inactive() which returns osErrorResource if the check is true. This might also be a bug. I will add a test for this.
Finally, there's a test test_thread_joinable_terminate(). AFAICT, it enforces that if thread A calls osThreadJoin() on a joinable thread B, and later thread B is killed with osThreadTerminate(), that A's call with osThreadJoin() should return with osErrorResource. This doesn't make any sense to me, I would expect it would join normally. Indeed, the spec says "osThreadTerminate destroys non-joinable threads and removes their thread_id from the system. Subsequent access to the thread_id (for example osThreadGetState) will return an osThreadError. Joinable threads will not be destroyed and return the status osThreadTerminated until they are joined with osThreadJoin." So I'm thinking a bug here too.

Fix would seem to be to also set the has_joined in osThreadExit.

Yeah, to me this looks like the shortest path to success.
I do not have much experience with CMSIS and would value suggestions/opinions.

Has there been any progress on this issue, I get the same problem when I switched from a cmsis v2 with RTX migration to FreeRTOS?


ReadWriteMany access mode is not supported

In case of a deployment (replication), ReadWriteMany is needed.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: longhorn-volv-pvc
spec:
accessModes:
- ReadWriteMany
storageClassName: longhorn
resources:
requests:
storage: 2Gi
Will be the feature possible in the future?

It's not possible for Longhorn to support ReadWriteMany, as with EBS and Google Persistent Disk. Block storage system will be presented as a disk on the host, and OS will put a filesystem on top of it. Any change in the block layer without the filesystem knowing will corrupt the data. So there cannot be multiple writer to a volume at the same time.

Thanks die info.

A user managed to create a Longhorn-backed ReadWriteMany PVC that seems to be mounted in a couple of Pods on the same node. So I checked the Rancher UI and didn't see any warning or validation that would stop me from creating those. What am I missing? Does this somehow actually work? Is it safe?

@rbq
RWX means the volume can be mounted as read-write by many *nodes*. So it's per node, not per pod. In this case, since all the pods are created on the same node, it's still per node. Once the pod gets scheduled away, Longhorn would error out since it cannot be attached to two nodes at the same time. So far it seems Kubernetes doesn't ask beforehand if the driver can be RWO or RWX, so there isn't a way to warn user before the actual attach happens.
You can use Longhorn for multiple pods on the same node with RWO too.

2021.8.16 is longhorn still not support RWX ,  I  run muti wordpress pod error when use longhorn
Mounting command: /bin/systemd-run
Mounting arguments: [--description=Kubernetes transient mount for /var/lib/kubelet/pods/e53af6ed-c640-4355-bd67-db1b54acb2bc/volumes/kubernetes.io~csi/pvc-e0fb118c-21e5-446a-a702-88ba21ffa8a2/mount --scope -- /bin/mount -t nfs -o vers=4.1,noresvport,soft,sync,intr,timeo=30,retrans=3 <IP_ADDRESS>:/pvc-e0fb118c-21e5-446a-a702-88ba21ffa8a2 /var/lib/kubelet/pods/e53af6ed-c640-4355-bd67-db1b54acb2bc/volumes/kubernetes.io~csi/pvc-e0fb118c-21e5-446a-a702-88ba21ffa8a2/mount]
Output: Running scope as unit: run-rd66e99af6e774810b3699267763987a9.scope
mount: /var/lib/kubelet/pods/e53af6ed-c640-4355-bd67-db1b54acb2bc/volumes/kubernetes.io~csi/pvc-e0fb118c-21e5-446a-a702-88ba21ffa8a2/mount: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.
  Warning  FailedMount  25m  kubelet  MountVolume.SetUp failed for volume "pvc-e0fb118c-21e5-446a-a702-88ba21ffa8a2" : rpc error: code = Internal desc = mount failed: exit status 32
Mounting command: /bin/systemd-run
Mounting arguments: [--description=Kubernetes transient mount for /var/lib/kubelet/pods/e53af6ed-c640-4355-bd67-db1b54acb2bc/volumes/kubernetes.io~csi/pvc-e0fb118c-21e5-446a-a702-88ba21ffa8a2/mount --scope -- /bin/mount -t nfs -o vers=4.1,noresvport,soft,sync,intr,timeo=30,retrans=3 <IP_ADDRESS>:/pvc-e0fb118c-21e5-446a-a702-88ba21ffa8a2 /var/lib/kubelet/pods/e53af6ed-c640-4355-bd67-db1b54acb2bc/volumes/kubernetes.io~csi/pvc-e0fb118c-21e5-446a-a702-88ba21ffa8a2/mount]
Output: Running scope as unit: run-r6c78648396a0495eac9cdfb83ce6d960.scope
mount: /var/lib/kubelet/pods/e53af6ed-c640-4355-bd67-db1b54acb2bc/volumes/kubernetes.io~csi/pvc-e0fb118c-21e5-446a-a702-88ba21ffa8a2/mount: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.
  Warning  FailedMount  7m29s (x3 over 18m)   kubelet  Unable to attach or mount volumes: unmounted volumes=[wordpress-data], unattached volumes=[wordpress-data default-token-sbnfc]: timed out waiting for the condition
  Warning  FailedMount  3m56s (x14 over 24m)  kubelet  (combined from similar events): MountVolume.SetUp failed for volume "pvc-e0fb118c-21e5-446a-a702-88ba21ffa8a2" : rpc error: code = Internal desc = mount failed: exit status 32
Mounting command: /bin/systemd-run
Mounting arguments: [--description=Kubernetes transient mount for /var/lib/kubelet/pods/e53af6ed-c640-4355-bd67-db1b54acb2bc/volumes/kubernetes.io~csi/pvc-e0fb118c-21e5-446a-a702-88ba21ffa8a2/mount --scope -- /bin/mount -t nfs -o vers=4.1,noresvport,soft,sync,intr,timeo=30,retrans=3 <IP_ADDRESS>:/pvc-e0fb118c-21e5-446a-a702-88ba21ffa8a2 /var/lib/kubelet/pods/e53af6ed-c640-4355-bd67-db1b54acb2bc/volumes/kubernetes.io~csi/pvc-e0fb118c-21e5-446a-a702-88ba21ffa8a2/mount]
Output: Running scope as unit: run-rea8257f364a84f56b9b863ffd1e0c325.scope
mount: /var/lib/kubelet/pods/e53af6ed-c640-4355-bd67-db1b54acb2bc/volumes/kubernetes.io~csi/pvc-e0fb118c-21e5-446a-a702-88ba21ffa8a2/mount: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.
  Warning  FailedMount  46s (x5 over 25m)  kubelet  Unable to attach or mount volumes: unmounted volumes=[wordpress-data], unattached volumes=[default-token-sbnfc wordpress-data]: timed out waiting for the condition

@willzhang it does, you need to have a nfs 4.1+ client installed on the worker nodes.


Fixed an exception that crashed the extension due to invalid language.

I fixed an exception that caused a crash when the extension tried to load an invalid language.
It happened when having the output window open and attempting to activate the extension.

(seems like I accidentally formatted as well. My apologies for that.)
The lines of interest is 133, 144, 208 or search for languageSpec to find the new addition


Added maximum of 230 devices.

Hi! My JA-107-K support 230 devices. This patch add support for that. Please consider adding it to the main repo.

Is it tested in your installation?

Is it tested in your installation?

Sure.