passing function that does not return FutureOr to Future.catchError leads to super confusing errors

import 'dart:async';
import 'dart:io';

void main() {
  onError(e) => true;

  new Future<int>(() => throw "haha").catchError(onError);
}

causes
╭─ ~/src/dart/sdk ‹master›
╰─$ out/ReleaseX64/dart /tmp/x.dart                                                     255 ↵
Unhandled exception:
type 'bool' is not a subtype of type 'FutureOr<int>'
#0      _FutureListener.handleError (dart:async/future_impl.dart:147:7)
#1      Future._propagateToListeners.handleError (dart:async/future_impl.dart:654:47)
#2      Future._propagateToListeners (dart:async/future_impl.dart:675:24)
#3      Future._completeError (dart:async/future_impl.dart:494:5)
#4      _completeWithErrorCallback (dart:async/future.dart:910:10)
#5      new Future.<anonymous closure> (dart:async/future.dart:178:9)
#6      Timer._createTimer.<anonymous closure> (dart:async/runtime/libtimer_patch.dart:21:15)
#7      _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
#8      _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
#9      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)

Not a single frame here belongs to the user code - so it is extremely hard to figure out where things went wrong.

Huge 👍 - see also https://github.com/dart-lang/sdk/issues/34144.

The initial cause of the problem is obviously that we can't type the Function argument to catchError because it has to allow both unary and binary functions. That means we cannot specify that the function must return FutureOr<T>. That ... is annoying. (Possible solutions involves splitting the function in two, only allowing a a binary function, or introducing union types, all of those are breaking changes).
The error here is a late error. We deliberately do not check the actual type of the function, because without a context type, the inferred type of a function literal might not be what it needs to be.
Example:
Future<SomeValue> future = ...;
future = future.catchError((error) => error.originalValue, (error) => error is SomethingWrongException);

Here, we know that the return type of the first function should be SomeValue, and indeed it is, because SomethingWrongException.originalValue has type SomeValue. Due to lack of type inference, we can't infer that return type, so the actual return type will be Object.
So, to not punish users for our lack of inference, we delay the type checks and only check the actual return value. That's obviously way later than when you pass the "wrong function"  - but your wrong function has the same type as other correct functions, so there is no way to detect that without breaking good code.
The "perfect" type for catchError would be:
Future<T> catchError<E>(FutureOr<T> handleError(E error, StackTrace stack), [bool test(E error)]);

This would infer and type-check the above example (with a , _ for the now mandatory stack trace) just as the user wants (and they can even omit the test function).
Without a way to refer to E in the handleError parameter, we can't use this kind of type-parameterization because we loose inference.
So, it's annoying, but hard to fix.

I guess another option is either:
(a) Writing a lint to "ban" Future.catchError (i.e. always use async/await, which is slower)
(b) Creating convenience functions in package:async, and ban direct use of Future.catchError:
Future<T> safeCatchError<T, E>(Future<T> future, FutureOr<T> Function(E) handle) {
  return future.catchError((e) {
    if (e is E) {
      return handle(e);
    }
    return new Future.error(e);
  });
}

Future<T> safeCatchStack<T, E>(Future<T> future, FutureOr<T> Function(E, StackTrace) handle) {
  return future.catchError((e, s) {
    if (e is E) {
      return handle(e, s);
    }
    return new Future.error(e, s);
  });
}

By ban, I mean write a lint, and enforce it in google3. I imagine other large projects care too

Note: I'm adding static analysis in the analyzer for this case in #35825 .


Removing csi-operator

Signed-off-by: Kumar Prashant<EMAIL_ADDRESS>Thanks submitting your Operator. Please check below list before you create your Pull Request.

Flat operator directory structure is obsolete from 23-rd of October 2019, only nested directory structure will be accepted.

New Submissions

[ ] Does your operator have nested directory structure?
[ ] Have you selected the Project Community Operator Submissions in your PR on the right-hand menu bar?
[ ] Are you familiar with our contribution guidelines?
[ ] Have you packaged and deployed your Operator for Operator Framework?

[ ] Have you tested your Operator in all supported installation modes?
[ ] Is your submission signed?

Updates to existing Operators

[ ] Is your new CSV pointing to the previous version with the replaces property?
[ ] Is your new CSV referenced in the appropriate channel defined in the package.yaml ?
[ ] Have you tested an update to your Operator when deployed via OLM?
[ ] Is your submission signed?

Your submission should not

[x] Modify more than one operator
[x] Modify an Operator you don't own
[x] Rename an operator - please remove and add with a different name instead
[x] Submit operators to both upstream-community-operators and community-operators at once
[x] Modify any files outside the above mentioned folders
[x] Contain more than one commit. Please squash your commits.

Operator Description must contain (in order)

[ ] Description about the managed Application and where to find more information
[ ] Features and capabilities of your Operator and how to use it
[ ] Any manual steps about potential pre-requisites for using your Operator

Operator Metadata should contain

[ ] Human readable name and 1-liner description about your Operator
[ ] Valid category name1
[ ] One of the pre-defined capability levels2
[ ] Links to the maintainer, source code and documentation
[ ] Example templates for all Custom Resource Definitions intended to be used
[ ] A quadratic logo

Remember that you can preview your CSV here.
--
1 If you feel your Operator does not fit any of the pre-defined categories, file an issue against this repo and explain your need
2 For more information see here

This PR is to related to PR #1916
csi-operator has been renamed to dell-csi-operator to correctly reflect what it does - Installation of CSI drivers provided by Dell. The two PRs has been created to comply with this specific submission guideline  -
Rename an operator - please remove and add with a different name instead


This Gem requires Redis implicitly

Hi, I didn't know this Gem will replace Async with Redis in the Action Cable Dev environment. Spent some time figuring out what happened when starting my dev env.
Just curious is it possible to stick to Async? Or at least we should mention that Redis is a prerequisite in the README.
Thanks!

Hi @zfz,
Unfortunately, broadcasting to the browser won't work with Async so we have to stick with Redis. I added it to Dependencies section in README: https://github.com/kirillplatonov/hotwire-livereload#dependencies


K8s 16

First commit updates from vendoring all of kubernetes to vendoring k8s.io/api, k8s.io/apimachinery, and k8s.io/client-go. Second commit updates references to api models.

Tests passing in dev. I had to revise a bit to update the deployment DeleteOptions to use the latest api, and now deleting a deployment actually cleans up the pods: https://github.com/18F/kubernetes-broker/pull/51/commits/f13dfb2ea1f3cd17165f8800cc5b5e2575f48cfb#diff-77ebf03ccd12754155661d15d1e2d377R375, which wasn't happening on my first attempt at this upgrade.


Radiation heat transfer

Description of the problem

This PR modifies the convection heat transfer boundary condition to convection-radiation. This new BC is a combination of convection and radiation. If the Stefan-Boltzmann constant (with default value = 0) is set to 0, only the convection component is considered, whereas if the convection coefficient, h (with default value = 0), is set to 0, only the radiation component is considered. Otherwise, both the convection and radiation are significant on the boundary.

It also adds "calculate temperature range" option to post-processing. By enabling "calculate temperature range", the solver reports the minimum and maximum temperature in the simulation domain.

How Has This Been Tested?

heat_transfer_laser application test is improved to test this new BC.

Documentation

boundary_conditions_multiphysics is updated.

Very good work. Do you plan on adding the capability to output this to a text file instead of just into the log? Or is that planned for a follow-up PR?

Is it necessary to write minimum and maximum temperatures in a text file? I think we will only need it for testing. The rest of comments have been addressed.

Very good work. Do you plan on adding the capability to output this to a text file instead of just into the log? Or is that planned for a follow-up PR?

Is it necessary to write minimum and maximum temperatures in a text file? I think we will only need it for testing. The rest of comments have been addressed.

Not necessary at all, you are right

Could you add a quick unit test with an analytical solution for pure radiation BC (like a couette with a radiation BC on one side orsomething) just to make sure the code work as intended :)

When CI passes, this seems very good to me! Only one question, would we also like a Conduction boundary condition?

Conduction BC is significant if we have two solids (with high k) in contact or the convection coefficient (h) is small, otherwise it is negligible.

@shahabgol it seems a lot of tests are breaking in debug mode?


Upgrade GraalVM version in installer.sh and some parsing fixes

On this PR:

Upgrade GraalVM version to 22.3.0 in installer.sh, together with some adjustments so the script works correctly
Fixed autocorrect logic in Options (ValidationError.InvalidValue is used now to suggest a correction instead of ValidationError.MissingValue. The problem with using MissingValue is that Options with default value handle this error and succeed with the default)
Fixed logic of Command.Single.parse

Hi @adamgfraser @kitlangton could you please review this PR? Thanks!


to_task function

I was implementing the MBE use case and we realized we needed the sources as referenced entries and not nested sub_sections.
This would lead the to_task function to fail because it doesn't find source.material (it is now source.reference.material)
Should be make to_task accept also referecnes @hampusnasstrom ?

@aalbino2, I think we should still have a nested source object which caries the instance data of the source in the deposition. Such as the temperature as a function of process time. What we discussed with Oliver was to have an additional entity for the whole instrument which would contain the "static" information of the source such as model, manufacturer, etc. This static data is also step independent I guess. In the filling of the instance data there could then be certain things which are filled by default from the instrument description. What do you think?

Anyways, the material should not be static but can I guess change from deposition to deposition. Unless you are referring to the crucible with the material in which case I think that can be the material reference.

Yeah, there are several viable ways that look all equally good.
I would in any case create a separate entry for the instrument with stable metadata such as chamber geometry, etc.
The metadata such as Temperature vs time can be placed in a nested section or in an entry, with not much substantial difference. I will try to stick to what we have now to avoid causing mess, though

By "I will try to stick to what we have now" do you mean the composed section as it is in the VaporDepostion data model?

exactly


Lack of flexibility and escape hatches

I am in the process of turning huge dynamically loaded config (that wasn't validated before and was simply huge interface) into a zod schema. I am running into some issues related to the fundamental lack of flexibility in zod. It seems like in some scenarios I cannot turn off validation in zod entirely.
Code like this:
interface Worker {
	doWork: (services: Service): Promise<void>;
}

services here is a complicated object with a variety of dependencies and I simply don't want to validate it in any way. I am fine with assuming that function provided by the user is correct. Also I don't want to suffer a performance impact by using args and returns. It seems like it's not possible to express this in any way in zod.

Using z.function() will end up being inffered as () => unknown.

z.object({doWork: z.function()})

Using z.any() ends up being inferred as optional property which is not what I wanted ie.

z.object({doWork: z.any().refine(v => v instanceof Function)})

is:
{
	doWork?: any
}

It would be cool to have some way to override type inferred by zod to anything else (it would also allow simple implementation for opaque types). For example:
z.object({doWork: z.function().cast<((services: Service) => Promise<void>)>()})

You can use cast to z.Schema<T> like this:
const schema: z.Schema<Service> = z.any();

This will allow any input to pass validation and still work with type inference. I'll try to document this better soon. 🤙

This is perfect! Thanks! I ended up using something like this:
const AnyFunc: z.Schema<(...args: any[]) => any> = z.any().refine((o) => o instanceof Function)

The same functionality can be used for tagged / branded types. It's not so obvious that you need to refine the z.any() type. For example:
type Tagged<T, Tag> = T & { __tag: Tag };
type UUID = Tagged<string, 'UUID'>;

const uuid: z.Schema<UUID> = z.any().refine(z.string().uuid().parse);

uuid.safeParse('ae6cd9c2-f2e0-43c5-919c-0640b719aacf'); // Success, data has type UUID
uuid.safeParse(5); // Fail
uuid.safeParse('foo'); // Fail

@lucaspiller @jraoult
A few things here. First, this can be abbreviated somewhat using z.custom() which is intended for this exact use case. See the code below for usage details.
There's also an error in that implementation. You shouldn't pass z.string().uuid().parse as a refinement function because it throws an error when the input is invalid. Currently errors that occur inside refinements are not caught by Zod. I recommend this approach:
const uuid = z.custom<UUID>(
  val =>
    z
      .string()
      .uuid()
      .safeParse(val).success,
);

console.log(uuid.safeParse('ae6cd9c2-f2e0-43c5-919c-0640b719aacf')); // Success, data has type UUID
console.log(uuid.safeParse(5)); // Fail
console.log(uuid.safeParse('foo')); // Fail

Everything works as expected:


feat: allow combobox and select components close after selection

This PR adds an option closeOnSelection to close the Combobox and Select components after selection.
There's no option to close those two components after selection with multiple values enabled, it closes only with the single selection mode. This PR allows to control the closing of the components after selection for both single and multiple modes, by default it matches the previous behavior.

Thanks!


Problem with install docker:

https://docs.docker.com/engine/installation/linux/debian/
i made all step from this tutorial
and when i try:
sudo apt-get install docker-engine (on root)
i have this error:
[...] docker-engine
E: Sub-process /usr/bin/dpkg returned an error code (1)
when i try:
sudo service docker start
Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.
i have debian 8 Jessie
2.6.32-042stab111.12

Is 2.6.32-042stab111.12 your kernel version?

is uname -r output

In that case, make sure to run an up to date kernel; docker requires kernel 3.10 as a minimum; https://docs.docker.com/engine/installation/linux/debian/#prerequisites

i run this cmd:apt-get install linux-image-3.16.0-4-amd64
but uname -r output is still 2.6.32-042stab111.12

Are you running bare-metal, on a cloud provider?

This kernel version looks like an openvz kernel. Is this an OpenVZ VPS?
If so, it is unlikely that you'll be able to switch what kernel you are running. A VPS host that does full virtualization should be able to give you a VPS that boots a kernel that you control.


Add SublimeLinter-phpcs installation instructions

Atom with linting ended up being insanely slow. SublimeLinter ain't as pretty but it gets the job done. =)

I would merge this, but I don't use Sublime so I can't verify it works :)

:thumbsup: Works for me xXx


[video_player] Audio can be occasionally played on VideoPlayerController initialization in web

Is there an existing issue for this?

[X] I have searched the existing issues
[X] I have read the guide to filing a bug

Steps to reproduce

Initializa several VideoPlayerControllers at the same time
See that audio is played

Expected results
Audio not played on VideoPlayerControllers initialization.
Actual results
Audio played on VideoPlayerControllers initialization.
Code sample
Code sample

import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  List<VideoPlayerController> controllers = [];

  void _incrementCounter() {

    controllers.clear();
    for (int i = 0; i < 10; i++) {
      controllers.add(VideoPlayerController.network(
        'https://movietrailers.apple.com/movies/paramount/the-spongebob-movie-sponge-on-the-run/the-spongebob-movie-sponge-on-the-run-big-game_h720p.mov',
        videoPlayerOptions: VideoPlayerOptions(),
      )..initialize());
    }

    setState(() {
      _counter++;
    });
  }

  @override
  void initState() {
    for (int i = 0; i < 10; i++) {
      controllers.add(VideoPlayerController.network(
        'https://movietrailers.apple.com/movies/paramount/the-spongebob-movie-sponge-on-the-run/the-spongebob-movie-sponge-on-the-run-big-game_h720p.mov',
        videoPlayerOptions: VideoPlayerOptions(),
      )..initialize());
    }
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ...controllers.map((e) => SizedBox.square(dimension: 50, child: VideoPlayer(e))),

            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}

Screenshots or Video

Video demonstration
https://github.com/flutter/flutter/assets/71345244/ebea0a9d-78cf-47e9-b47b-87f69bbee7b8

Logs
No response
Flutter Doctor output
Doctor output

[√] Flutter (Channel stable, 3.10.2, on Microsoft Windows [Version 10.0.22621.1778], locale ru-RU)
    • Flutter version 3.10.2 on channel stable at C:\Users\Andri\Documents\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9cd3d0d9ff (2 weeks ago), 2023-05-23 20:57:28 -0700
    • Engine revision 90fa3ae28f
    • Dart version 3.0.2
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at C:\Users\Andri\AppData\Local\Android\sdk
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

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

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.5.33516.290
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2022.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)

[√] IntelliJ IDEA Ultimate Edition (version 2022.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2022.1.2
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.78.2)
    • VS Code at C:\Users\Andri\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22621.1778]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 114.0.5735.90
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 113.0.1774.50

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Thanks for the report @krida2000
Check if your case is similar to https://github.com/flutter/flutter/issues/124210 or not.
For reference: https://github.com/flutter/flutter/issues/124210#issuecomment-1507843852, https://github.com/flutter/flutter/issues/124210#issuecomment-1513885827

I don't think they are similar. In my case, each video has its own controller. And I don't see any problems with audio in that issue.

Thanks for the feedback. Using details provided, I was able to replicate the reported behavior.

 stable, master flutter doctor -v
[!] Flutter (Channel stable, 3.10.3, on macOS 12.2.1 21D62 darwin-x64, locale
    en-GB)
    • Flutter version 3.10.3 on channel stable at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f92f44110e (4 days ago), 2023-06-01 18:17:33 -0500
    • Engine revision 2a3401c9bb
    • Dart version 3.0.3
    • DevTools version 2.23.1
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

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

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

[!] Flutter (Channel master, 3.12.0-2.0.pre.20, on macOS 12.2.1 21D62
    darwin-x64, locale en-GB)
    • Flutter version 3.12.0-2.0.pre.20 on channel master at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 1bd1b5014c (4 hours ago), 2023-06-07 18:16:30 -0700
    • Engine revision a5f7d5d75f
    • Dart version 3.1.0 (build 3.1.0-171.0.dev)
    • DevTools version 2.24.0
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/dhs/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13C100
    • CocoaPods version 1.11.2

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

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 65.1.4
    • Dart plugin version 213.7228

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.29.0

[✓] Connected device (3 available)
    • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios
      • iOS 15.3.1 19D52
    • macOS (desktop)           • macos                                    •
      darwin-x64     • macOS 12.2.1 21D62 darwin-x64
    • Chrome (web)              • chrome                                   •
      web-javascript • Google Chrome 109.0.5414.119

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

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

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

how it's going on, i have same issue

Are videos actually playing? Can you hear the audio? Or is it just the "sound" icon on the tab showing?

I can hear the audio.

Videos is not playing, but the audio of videos is play about 1 second then its stop playing.

It seems like you're trying to create too many instances of platform views at once.

Flutter was unable to create enough overlay surfaces. This is usually caused by too many platform views being displayed at once. You may experience incorrect rendering.

Your code always creates 10 new platform views and drops the old ones. I was able to reproduce the issue, but when I hit the floating action button for the 50th time, I received this warning on the console. The audio was playing for about 1 second and the screen also went black for approximately 1 second.

WebGL: CONTEXT_LOST_WEBGL: loseContext: context lost

If you add videos one by one, this does not happen, so this bug is not releated to video player package rather how flutter handles platform views:
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  List<VideoPlayerController> controllers = [];

  void _incrementCounter() {
    controllers.add(
      VideoPlayerController.network(
        'https://movietrailers.apple.com/movies/paramount/the-spongebob-movie-sponge-on-the-run/the-spongebob-movie-sponge-on-the-run-big-game_h720p.mov',
        videoPlayerOptions: VideoPlayerOptions(),
      )..initialize(),
    );

    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Wrap(
          direction: Axis.vertical,
          children: <Widget>[
            ...controllers.map((e) => SizedBox.square(dimension: 50, child: VideoPlayer(e))),
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}

Via plain html + js this doesn't happen (imitating current video_player package):
<!DOCTYPE html>
<html>
<head>
    <title>Video Page</title>
</head>
<body>
    <button id="resetVideos">Reset Videos</button>

    <script>
        function setVolume(videoElement, volume) {
            videoElement.muted = !(volume > 0.0);
            videoElement.volume = volume;
        }

        function setLooping(videoElement, looping) {
            videoElement.loop = looping;
        }

        function _applyPlayPause(videoElement, isPlaying) {
            if(isPlaying) {
                videoElement.play();
            } else {
                videoElement.pause();
            }
        }

        function logEvent(event) {
            console.log(event.type, event);
        }

        function createVideo() {
            var video = document.createElement('video');
            video.src = "https://movietrailers.apple.com/movies/paramount/the-spongebob-movie-sponge-on-the-run/the-spongebob-movie-sponge-on-the-run-big-game_h720p.mov";
            video.style.border = 'none';
            video.style.width = '150px';
            video.style.height = '150px';
            video.autoplay = false;
            video.controls = false;

            // Allows Safari iOS to play the video inline
            video.setAttribute('playsinline', 'true');

            // Set autoplay to false since most browsers won't autoplay a video unless it is muted
            video.setAttribute('autoplay', 'false');

            video.addEventListener('canplay', function(event) {
                logEvent(event);
                setLooping(video, true);
                setVolume(video, 1.0);
                _applyPlayPause(video, false);
            });
            video.addEventListener('canplaythrough', logEvent);
            video.addEventListener('playing', logEvent);
            video.addEventListener('waiting', logEvent);
            video.addEventListener('error', logEvent);
            video.addEventListener('play', logEvent);
            video.addEventListener('pause', logEvent);
            video.addEventListener('ended', logEvent);

            document.body.appendChild(video);
            return video;
        }

        let videos = Array(10).fill().map(() => createVideo());

        document.getElementById('resetVideos').addEventListener('click', function() {
            // dispose called by platform view
            videos.forEach(video => {
                video.removeAttribute('src');
                video.load();
            });

            // recreate the videos
            setTimeout(() => {
                videos.forEach(video => document.body.removeChild(video));
                videos = Array(10).fill().map(() => createVideo());
            }, 100);
        });
    </script>
</body>
</html>

I'm surprised that audio starts playing, you shouldn't get any audio playback from an auto-playing video player on the web at all. I'm sure flutter is messing up the platform views, but the audio playing looks like a Chrome browser bug to me as well.
(I guess mashing the FAB is ticking the box of "user activation" required to enable sound in the video?)

have related issue #135589
any updates on this?

@d-polikhranidi nope, no updates on this, as I said this is a very odd issue, because on the web audio doesn't auto-play, so it must be an effect of the "mash the FAB to add many video players" reproduction step.

I'm having the same issue with just a single video. For <1 second on web, it plays the video with volume on max then goes on mute as expected. I tried re-arranging the order of setVolume before/after initialize but it does not make a difference.
    await videoPlayerController?.setVolume(0);
    await videoPlayerController?.initialize();
    await videoPlayerController?.setLooping(true);
    await videoPlayerController?.play();

@CFarzaneh can you attempt to check the value of UserActivation.isActive and/or UserActivation.hasBeenActive and see what you get when your video autoplays? MDN docs
I think this is a side effect of user activation not being fully consumed by the time the video is painted by the browser.


proposal: all: add opt-in transparent telemetry to Go toolchain

In February I posted a series of blog posts defining Transparent Telemetry, and we had a lively discussion on #58409. In the original posts, the design was opt-out. Based on that discussion as well as private discussions with long-time contributors and users, I revised the design to be opt-in.
I propose that we add opt-in transparent telemetry to the Go toolchain as described in those posts, specifically “The Design of Transparent Telemetry.” Transparent Telemetry has the following key properties:

The decisions about what metrics to collect are made in an open, public process.
The collection configuration is automatically generated from the actively tracked metrics: no data is collected that isn’t needed for the metrics.
The collection configuration is served using a tamper-evident transparent log, making it very difficult to serve different collection configurations to different systems.
The collection configuration is a cacheable, proxied Go module, so any privacy-enhancing local Go proxy already in use for ordinary modules will automatically be used for collection configuration.
Uploaded reports only include total event counts over a full week, not any kind of time-ordered event trace.
Uploaded reports do not include user IDs, machine IDs, or any other kind of ID.
Uploaded reports only contain strings that are already known to the collection server: counter names, program names, and version strings repeated from the collection configuration, along with the names of functions in specific, unmodified Go toolchain programs for stack traces. The only types of non-string data in the reports are event counts, dates, and line numbers.
IP addresses exposed by the HTTP session that uploads the report are not recorded with the reports.
Thanks to sampling, only a constant number of uploaded reports are needed to achieve a specific accuracy target, no matter how many installations exist. Specifically, only about 16,000 reports are needed for 1% accuracy at a 99% confidence level. This means that as new systems are added to the system, each system reports less often. Exactly how often will depend on how many systems opt in.
The aggregate computed metrics are made public in graphical and tabular form.
The full raw data as collected is made public, so that project maintainers have no proprietary advantage or insights in their role as the direct data collector.
The system is off by default and requires an explicit opt-in.

Please note, as described in the Why Telemetry? section of the intro post, that telemetry addresses a different kind of problem than bug reports and surveys. In particular, relying on bug reports is not sufficient to identify problems that don't obviously impact functionality, including performance problems, and surveys are not sufficient to identify the variety of usage and contexts where Go is used and which would inform prioritization of effort.
There is good reason to believe that with even tens of thousands of users opted in, we should be able to get helpful data. It will not be as complete as the opt-out system, but it should be good enough. As described in the Can We Still Make Good Decisions? section of the opt-in post, there will be certain biases in the data based on who is more likely to opt in. Once we have data, it would make sense to compare “technical demographics” like operating system and editor against the annual Go survey and Stack Overflow surveys. If there is significant skew, we could look into reweighting the data as standard polls do (https://en.wikipedia.org/wiki/Iterative_proportional_fitting).
For examples of the kinds of questions we'd use telemetry to answer and the kinds of decisions those answers would inform (but not decide directly), see “Use Cases for Transparent Telemetry”.

I think it's great to hear that this will be opt in. That and the fact you listened to the community on this important moral point restores my confidence in the Go team. As for the skew, that is inevitable, but also fair. If you don't opt in you don't get to influence the results.

This proposal has been added to the active column of the proposals project
and will now be reviewed at the weekly proposal review meetings.
— rsc for the proposal review group

@rsc I didn't get a chance to ask this before the discussion was closed:

Uploaded reports only contain strings that are already known to the collection server: counter names, program names, and version strings repeated from the collection configuration, along with the names of functions in specific, unmodified Go toolchain programs for stack traces.

Why not assign every known string a number, and then use those numbers instead of sending strings? While sending the strings themselves is equivalent to the numbers, there's a "slippery slope" whiff I get from it. Publishing the known string index is another way to assure users that their privacy is being protected. There's an extra feeling of security knowing that only numbers are being sent.

@willfaught I actually think it would be less transparent, not more. Because instead of seeing the actual human-readable information that is sent, you get a bunch of cryptic numbers that you have to interpret. Even if it was increasing a "feeling of privacy", there is a good argument to be made that giving such a feeling without actually increasing privacy (which this wouldn't do) is a bad thing. This would be privacy theater, if you will. Combine that with the fact that this would be significantly more churn and work - you either have the mapping be automatic, in which case it might completely re-number everything on every Go release, or you have to manually keep it up to date whenever something changes - and this seems an overall pretty bad idea.

I think this should be some optional component to the tool chain and not installed by default as I bet most users will turn it off anyway.

Thank you for:
allowing anyone to participate in this this conversation
listening to the community
making improvements based on public feedback
So far I see I thoughtfully and polished proposal with user privacy as a fundamental guideline.
Currently I'm prone to contribute and participate opting in, as this is a clear and reasonable way to help furthering the language development.
I trust the spirit of the proposal that safeguards the balance between privacy and functionality is preserved and never broken.
I'm making these comments as simple user who has chosen to use the language for work and personal use for many years now, not having any significant reason to doubt or question this choice.
Grateful for the work being done and the direction where the language is going.

I actually think it would be less transparent, not more. Because instead of seeing the actual human-readable information that is sent, you get a bunch of cryptic numbers that you have to interpret.

Most of the data sent will be counters/numbers anyway. The format is binary, if I remember correctly, so it can be mmap'ed. This wouldn't affect the human readability of the data either way.

Even if it was increasing a "feeling of privacy", there is a good argument to be made that giving such a feeling without actually increasing privacy (which this wouldn't do) is a bad thing. This would be privacy theater, if you will.

Avoiding a slippery slope isn't theater.

Combine that with the fact that this would be significantly more churn and work - you either have the mapping be automatic, in which case it might completely re-number everything on every Go release, or you have to manually keep it up to date whenever something changes - and this seems an overall pretty bad idea.

In my opinion, there isn't much widespread sympathy for having to do more work to do the right, best thing in terms of privacy. This change in direction happened because the community insisted that the Go team do the harder thing. Russ acknowledged that this change will require more work:

For all these reasons, I've revised the design to be opt-in (default off). Doing so does introduce at least two costs: first, we must run an ongoing campaign to educate users about opting in is a good choice for them, and second, with fewer systems reporting, the telemetry cost imposed on any particular user is higher.

So I don't think it's necessarily relevant how hard it is, not without a careful tradeoff analysis. And I doubt it would entail as much hassle as you make it out to be, once a process is in place. For instance, the index can be immutable, and added to over time and releases with an AST scan. There may indeed be a good reason not to do this, but I'm not convinced that this is one of them.

Most of the data sent will be counters/numbers anyway. The format is binary, if I remember correctly, so it can be mmap'ed. This wouldn't affect the human readability of the data either way.

Hi @willfaught, there is a binary file used for performance reasons, but as I understand it, the uploaded data is purposefully in human-readable JSON:

Recall from above that the local, binary counter files are stored in /go/telemetry/local/. When a report is uploaded, the exact JSON that was uploaded is written to /go/telemetry/uploaded/, named for the day of the upload (2006-01-02.json). The aim of both these directories (including their naming) is to make the system’s overall operation as transparent as possible.

If the Go toolchain was to be underhanded about what it is doing, information could in theory be smuggled in a series of words or a series of numbers.
For someone opting in, I suspect they will need to rely on the Go toolchain being open source (and either look at the code themselves, or rely on likelihood of others doing so, or otherwise placing some trust in "open source", etc.) to reduce the chance of the Go toolchain doing something underhanded. That would include the Go toolchain being underhanded about how it handles strings.
If someone crosses that threshold of trust and is willing to opt in, I tend to agree with @Merovius that plain text strings in a file on disk are easier to understand and help with transparency more than a series of numbers.

Most of the data sent will be counters/numbers anyway. The format is binary, if I remember correctly, so it can be mmap'ed. This wouldn't affect the human readability of the data either way.

From https://research.swtch.com/telemetry-design:

... the local, binary counter files are stored in /go/telemetry/local/. When a report is uploaded, the exact JSON that was uploaded is written to /go/telemetry/uploaded/, named for the day of the upload (2006-01-02.json).

I think this is saying the counter files are locally compact, but emitted as JSON. In the original thread someone made the point that plaintext is a good clue to someone who is sniffing traffic what's going on, that made sense to me. In a wonky way, a set of plaintext strings is already a set of unique numbers in this kind of scenario.

I see. It's hard to judge the readability of {"foo": 12} vs. {"46": 12} without knowing what foo might be, but if the string index is published, people can work out for themselves that {"46": 12} means {"error_when_build_stdlib": 12}. Most of the time, nobody is going to be looking at these, especially if they have numbered keys, so optimizing their readability doesn't seem that important. It would be trivial to write a little tool people could use to translate the string IDs in what was sent into the strings themselves, if they want to know.
I think the bigger concern—bigger than the malicious sending of personal data strings—is the accidental sending of personal data strings. Nobody wants "home_video_of_[embarrassing thing].mov" or "[embarrassing thing]website.com/go-foo/bar" accidentally sent to the Go team. And perhaps no one will file an issue to fix it either, out of embarrassment, when the problem is discovered. Not sending any strings at all rules out that possibility entirely.

By design only strings that are explicitly requested by the telemetry server will be sent to the telemetry server.  Of course we can't stop anyone from modifying the Go tools to send other strings, but it hardly seems likely to happen by accident.

@willfaught publishing numbers instead of strings  is a false sense of security.  It accomplishes nothing. Who does it protect from when the strings are public and can be consulted anytime by anyone? Users would be more comfortable reading and understating right there what is being sent instead of cross-referencing that is a burden for the user an no burden for any would-be malicious actors.
As it is, with the change to the Opt-in Mechanism, this is a very good balanced approach.

@willfaught

And I doubt it would entail as much hassle as you make it out to be, once a process is in place. For instance, the index can be immutable, and added to over time and releases with an AST scan.

Note that one class of strings are counter names and the counter names might be a full stack trace (function names and line number offsets). The space is large. So, no, I don't think I'm overstating the hassle.
And, again, I think this actually worsens the privacy and transparency of the design and makes it easier to abuse, if anything. I agree that doing extra work might be worth it, if it improved privacy - but in this case, it's a lose-lose, you'd have to do extra work to make things worse.

Note that one class of strings are counter names and the counter names might be a full stack trace (function names and line number offsets). The space is large. So, no, I don't think I'm overstating the hassle.

Ah, I see, then the string space might indeed be very large. Makes sense.

Have all concerns about this proposal been addressed?

No change in consensus, so accepted. 🎉
This issue now tracks the work of implementing the proposal.
— rsc for the proposal review group

@matloob with the 1.23 release, is this done?


An error occurs when adding one custom environment if the 'Use app proxy settings' is applied

Storage Explorer Version: 1.21.1
Build Number: 20210917.4
Branch: hotfix/1.21.1
Platform/OS: Windows 10
Architecture: ia32
How Found: Exploratory testing
Regression From: Previous release (1.19.1)
Steps to Reproduce

Make sure Fiddler is configured well -> Launch Storage Explorer.
Go to 'Settings -> Applications' -> Select 'Use app proxy settings'.
Set the URL: 'http://localhost' Port: '8888'.
Open the connect dialog -> Select 'Subscription -> Custom Environment:' -> Click 'Manage custom environments...'.
Click 'Add' -> Type a valid Environment name -> Type 'https://management.azure.com' to ARM endpoint.
Click 'Add' -> Check whether succeed to add.

Expected Experience
Succeed to add.
Actual Experience
An error 'Unable to retrieve configuration. Please verify that the ARM endpoint is correct' occurs.

Additional Context

This issue also reproduces when selecting 'Use environment variables'.

Fiddler is well configured
Open a command line prompt -> Navigate to the location path of the Storage Explorer.
Type the command 'set HTTP_PROXY=http://localhost:8888'.
Open Storage Explorer from the command line.
Select 'Use environment variables'.
Repeat the above steps <4-6> under Steps to Reproduce part.

Here is the record:

@v-xianya I'm able to reproduce this. The error that occurs appears to be related to certificates:
Error: unable to verify the first certificate
    at TLSSocket.onConnectSecure (_tls_wrap.js:1497:34)
    at TLSSocket.emit (events.js:315:20)
    at TLSSocket._finishInit (_tls_wrap.js:932:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:706:12)
    at TLSWrap.callbackTrampoline (internal/async_hooks.js:131:14) {code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE', stack: 'Error: unable to verify the first certificate…ckTrampoline (internal/async_hooks.js:131:14)', message: 'unable to verify the first certificate'}

I was able work around this issue by disabling the Decrypt HTTPS traffic option (Tools > Options... > HTTPS).
I don't think this is something we need to fix unless customers using real proxies start reporting the same issue.

Fixed on the hotfix build 20210918.4.


Synthesizing a js.Function0 inside a function whose name starts with lambda crashes the compiler

object A {
  def lambdaAnything() = {
    test(() => 1)
  }

  def test(cmp: js.Function0[Int]) = ()
}

Scala versions tested: 2.12.5, 2.13.8
Notes:

Just js.Function compiles
scala.Function0[Int] compiles
Changing lambdaAnything to alambdaAnything compiles.
val x: Function0[Int] = () => 1  compiles.
Does not crash on 2.11.12.

[error] Error while emitting HelloWorld.scala
[error] assertion failed:
[error]   HelloWorld$$anonfun$lambdaAnything$2
[error]      while compiling: /home/tos/gh/scala-js/examples/helloworld/src/main/scala/helloworld/HelloWorld.scala
[error]         during phase: jvm
[error]      library version: version 2.12.15
[error]     compiler version: version 2.12.15
[error]   reconstructed args: -bootclasspath /home/tos/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.15/scala-library-2.12.15.jar -deprecation -encoding utf8 -feature -unchecked -Xfatal-warnings -Wconf:cat=feature:w -Wconf:cat=unchecked:w -Wconf:cat=deprecation:w -Wconf:cat=deprecation:ws -Wconf:cat=feature:ws -Wconf:cat=optimizer:ws -classpath /home/tos/gh/scala-js/examples/helloworld/.2.12/target/scala-2.12/classes:/home/tos/gh/scala-js/library/.2.12/target/scala-2.12/scalajs-library_2.12-1.10.1-SNAPSHOT.jar -Xplugin:/home/tos/gh/scala-js/compiler/.2.12/target/scala-2.12/scalajs-compiler_2.12.15-1.10.1-SNAPSHOT.jar
[error]
[error]   last tree to typer: TypeTree(<$anon: scala.scalajs.js.Function with scala.scalajs.js.Function0>)
[error]        tree position: line 28 of /home/tos/gh/scala-js/examples/helloworld/src/main/scala/helloworld/HelloWorld.scala
[error]             tree tpe: helloworld.anonfun$lambdaAnything$2
[error]               symbol: final <$anon: scala.scalajs.js.Function with scala.scalajs.js.Function0> in package helloworld
[error]    symbol definition: final class anonfun$lambdaAnything$2 extends Function with Function0 (a ClassSymbol)
[error]       symbol package: helloworld
[error]        symbol owners: <$anon: scala.scalajs.js.Function with scala.scalajs.js.Function0>
[error]            call site: constructor HelloWorld$$anonfun$lambdaAnything$2 in package helloworl
[error]
[error] == Source file context for tree position ==
[error]
[error]     25   //}
[error]     26
[error]     27   def lambdaAnything() = {
[error]     28     test(() => 1)
[error]     29   }
[error]     30
[error]     31   def test(cmp: js.Function0[Int]) = ()
[error] Error while emitting HelloWorld.scala
[error] assertion failed: HelloWorld$$anonfun$lambdaAnything$2
[error] two errors found
[error] (helloworld2_12 / Compile / compileIncremental) Compilation failed
[error] Total time: 1 s, completed Apr 25, 2022, 9:26:16 PM

Discovered while working on: https://github.com/scala-js/scala-js/pull/4652#issuecomment-1108945649

I can reproduce with Scala 2.13.8 without Scala.js being involved:
$ cs launch scala:2.13.8
Welcome to Scala 2.13.8 (OpenJDK 64-Bit Server VM, Java 1.8.0_312).
Type in expressions for evaluation. Or try :help.

scala> trait JSFunction0[+R] { def apply(): R }
trait JSFunction0

scala> object A { def lambdaAnything() = test(() => 1); def test(cmp: JSFunction0[Int]) = () }
error: Error while emitting <console>
assertion failed:
  A$$anonfun$lambdaAnything$2
     while compiling: <console>
        during phase: jvm
     library version: version 2.13.8
    compiler version: version 2.13.8
  reconstructed args: -deprecation -feature -Wconf:cat=feature:w -Wconf:cat=deprecation:w -Wconf:cat=deprecation:ws -Wconf:cat=feature:ws -Wconf:cat=optimizer:ws

  last tree to typer: Literal(Constant(type))
       tree position: line 1 of <console>
            tree tpe: Class(classOf[])
              symbol: null
           call site: constructor A$$anonfun$lambdaAnything$2 in package $line6

== Source file context for tree position ==

     1 object A { def lambdaAnything() = test(() => 1); def test(cmp: JSFunction0[Int]) = () }
error: Error while emitting A$
assertion failed: A$$anonfun$lambdaAnything$2

scala> object A { def alambdaAnything() = test(() => 1); def test(cmp: JSFunction0[Int]) = () }
object A

So it's not a bug on our end. We should report it to scala/bug instead.
Scala 3.x does not seem to exhibit the issue.

Hum... I was about to file a bug to scala/bug but I cannot reproduce this with just Scala:
trait JSFunction0[+R] { def apply(): R }

object A {
  def lambdaAnything() = test(() => 1)
  def test(cmp: JSFunction0[Int]) = ()
}

$ sbt '++2.13.8!; compile'
[info] welcome to sbt 1.6.2 (Private Build Java 11.0.15)
[info] loading project definition from /tmp/test/project
[info] set current project to test (in build file:/tmp/test/)
[info] Forcing Scala version to 2.13.8 on all projects.
[info] Reapplying settings...
[info] set current project to test (in build file:/tmp/test/)
[info] compiling 1 Scala source to /tmp/test/target/scala-2.13/classes ...
[success] Total time: 3 s, completed May 7, 2022, 5:20:30 PM

I reproduced it outside the REPL with both 2.12.15 and 2.13.8 with this modified version (note the class JSFunction):
package test

class JSFunction

trait JSFunction0[+R] extends JSFunction {
  def apply(): R
}

object A {
  def lambdaAnything() = test(() => 1)
  def test(cmp: JSFunction0[Int]) = ()
}

That causes JSFunction0 not to be a SAM type from the point of view of the JVM. This triggers different code paths in the JVM back-end.

Looks like it was already reported a while ago as https://github.com/scala/bug/issues/10857


⚠ Jenkins Plugins Artifactory has degraded performance

In e45fe80, Jenkins Plugins Artifactory (https://get.jenkins.io/plugins/artifactory/) experienced degraded performance:

HTTP code: 200
Response time: 1280 ms

Resolved: Jenkins Plugins Artifactory performance has improved in 86b7704 after 29 minutes.


PR:  Don't offer updates for development versions

Fixes #7862

Hello @ccordoba12! Thanks for submitting the PR.

There are no PEP8 issues in the file spyder/utils/tests/test_programs.py !

There are no PEP8 issues in the file spyder/workers/tests/test_update.py !

There are no PEP8 issues in the file spyder/workers/updates.py !

The code to detect a development version was wrong.

A few minor comments/suggestions; feel free to ignore them if you don't agree with any of them.

All of them were good suggestions and led me to improve much more this work. Thanks a lot for your review @CAM-Gerlach!


Adds support for pydantic based input validation

Extends Flask tools' capability to use pydantic models when creating and validating request input, ActionRequests, and ActionStatuses. Developers can choose to use pydantic models or write jsonschema definitions by hand.
The general idea is that when an ActionProvider starts up, it inspects its ActionProviderDescription to determine if its input schema is a str, dict, or pydantic model. Depending on the type of its input schema, the appropriate validation function (json-schema or pydantic based) is loaded and used to validate incoming requests. Since the ActionRequest and ActionStatus objects are now pydantic models which throw ValidationErrors if created with the wrong data, the Flask helpers now run the user supplied callbacks in try-except blocks and log errors/raise exceptions appropriately.
Refactors a bit to stay DRY and adds tests + docs.
[ch5660]

@jimPruyne gave this an update based on the review we just had. What do you think?

@jimPruyne gave this an update based on the review we just had. What do you think?


Moves model parsing into AbstractDTOBackend.

This PR moves the bulk of the logic for parsing a model type from AbstractDTOFactory to AbstractDTOBackend. This is purely a refactor - no functionality change - just moves functions (that were private anyway) to within the _backend module.
The immediate motivation for this is to move the implementation of renaming_strategy from the frontend to the backend. Our configuration for this closely mirrors that of msgspec, and so by making the field parsing part of the backend, this will allow us to defer field renaming to msgspec, or use our own implementation of the renaming strategy for other backend types.
Pull Request Checklist

[x] New code has 100% test coverage
[ ] (If applicable) The prose documentation has been updated to reflect the changes introduced by this PR
[ ] (If applicable) The reference documentation has been updated to reflect the changes introduced by this PR

By submitting this issue, you agree to:

follow Litestar's Code of Conduct
follow Litestar's Contribution Guidelines

Description
Close Issue(s)

Nice one @peterschutt!


Proposal: Extending Jax MD with Monte Carlo Capabilities and Bonded Potentials

Dear Jax MD maintainers,
I am writing to inquire about the possibility of extending the capabilities of Jax MD, specifically by incorporating additional Monte Carlo (MC) methods and bonded potentials into the codebase. I work with molecular systems, glasses and high entropy alloys and think that MC would greatly help my research, this project and the general community.
My plans would be to first introduce standard methods (e. g. Widom insertion), standard MC moves (translation, rotation, etc. pp.) and then move to the more advanced things like various configurational-bias moves and some non-standard ensembles. I need bonded potentials as I want to simulate molecules or glasses with well defined chemical bonds, so I aim to implement the simple standard potentials there too.
I am planning to start working on these extensions towards the end of the year, depending some grant decisions as I am currently transitioning from PhD student to postdoc.
Thank you for your time and consideration. I look forward to hearing your thoughts on this matter.
Best regards
Stefan Hiemer

Hi Stefan,
I would also be interested in extending JAX MD to incorporate Monte Carlo methods. Is it possible to reach out to you via email?
Best regards,
Abhijeet Gangan

Hi Abhijeet,
my contacts are there
https://www.matsim.techfak.uni-erlangen.de/staff/stefan-hiemer.shtml
Regards
Stefan

I don't want to speak for the main developers, but it sounds like you are actually suggesting two separate extensions: 1) more bounded potentials, and 2) a suite of MC functionality. Is there a reason I don't realize that these are actually more intricacy connected?
There are some bond potential functionality, though its not very robust. At some point I wrote a generic 3-body interface, but I don't think it ever got merged with the main branch.
Regarding the MC functionality, you elaborated a bit in the original post about what these functionalities would be, but I'm wondering if you could expand a bit. Or perhaps better is there a MC package out there with built-out and documented functionality that could be used as a reference?
Do you have a sense of how well these MC functions (or at least standard implementations of them) would play with basic JAX transformations like jit and grad?

Hi there,
regarding your first question:
MC and bonded potentials are connected as many moves used especially for proteins or polymers make explicit use of the bonded-nonbonded separation to (re-)grow molecules/proteins. Just take a look at the figures in this publication and you will probably understand it by intuition:
Chameleon: A generalized, connectivity altering software for tackling properties of realistic polymer systems
What type of MC functionality I would like to add:
I would like to add them in different stages as to see how fast I can implement stuff and what I have to rewrite in Jax as

Standard MC moves

random translation/rotation,
Widom insertion (muVT)
box volume change (NPT)
Parts of this are already implemented in LAMMPS (https://docs.lammps.org/Packages_details.html#pkg-mc), so one can readily compare the implementations with lammps

Moves specific to crystals like lattice switch Monte Carlo which we can compare this with monteswitch (https://github.com/tomlunderwood/monteswitch). There need to be added some tricks to more efficiently sample different lattices.

Moves under constant tension/stress along the lines of these publications:

R. F. Najafabadi, “Monte carlo simulation of structural and mechanical properties of crystal and bicrystal systems at finite temperature,” Ph.D. dissertation, Massachusetts Institute of Technology, 198
R. Najafabadi and S. Yip, “Observation of finite-temperature bain transformation (fcc→ r bcc) in monte carlo simulation of iron,” Scripta metallurgica, vol. 17, no. 10, pp. 1199–1204, 1983
Unfortunately I am not aware if this specific method has been implemented somewhere.
If you do not want to read those entirely I recommend to read the chapter 5.5 in Daan Frenkel's standard textbook.

Ensembles to study quasistatic fracture with a pseudo grandcanonical ensemble where the chemical potential is used to pick off bonds, so this method also relies very much on bonded potential (at least in its vanilla form):

J. P. Nilmeier, G. E. Crooks, D. D. Minh, and J. D. Chodera, “Nonequilibrium candidate monte carlo is an efficient tool for equilibrium simulation,” Proceedings of the National Academy of Sciences, vol. 108, no. 45, pp. E1009–E1018, 2011.
T. Mulla, S. Moeini, K. Ioannidou, R.-M. Pellenq, and F.-J. Ulm, “Phase diagram of brittle fracture in the semi-grand-canonical ensemble,” Physical Review E, vol. 103, no. 1, p. 013003, 2021
I am not aware that any package has implemented this already, but I may be able to contact the authors via common connections.

Configurational bias moves for molecule/atom insertion and regrowth. This can be readily compared with Towhee and should enable Jax Md to deal with molecular systems and generate complicated geometries in the first place. A lot of those methods are already implemented in Towhee, but that code is entirely serial and is more or less dead. Marcus Martin still maintains it, but no further development takes place. I want to expand these methods later to other systems like glasses. If you want to know more about this, check either the chapter in Daan Frenkel's book or this essay by Marcus Martin https://towhee.sourceforge.net/algorithm/cbmc.html

We can compare here the implementations with Towhee.
Regarding JIT and automatic differentiation, I see no reason why these should fail in the MC case. The only conflicts with Jax MDs current architecture that I can image is the parallelization that might be suboptimal with MC. But that we have to check which is why I want to implement simple things at first, benchmark to check the performance and then  propose changes if necessary. Personally I am not to worried that much I have to admit.
Have I answered your questions? Or do you need more details?
Regards
Stefan

Dear Stefan,
This is a very interesting proposal!  Any updates on this "Proposal: Extending Jax MD with Monte Carlo Capabilities and Bonded Potentials"?
Best,
Charles

Hi Charles,
no progress, but I've got a grant where I will implement some MC use in Jax MD. The prject will start in march and I am currently in the process of moving to another country and finishing stuff up. That's why I have not done any programming yet.
@charles-liang999  Anything specific from my list that you are especially interested? Maybe I can implement it first then and have you then as a tester.
Regards
Stefan

@stefanhiemer Cool!  I am interested in standard MC moves, including NVT MC and the ones listed.
Best,
Charles


Animated stub image

Hi , first of all i wanted to say that this project is very awesome :)
Now my question, is it possible to have an animated "loader image" like a "gif"  as a stub image.?
Like in Screenshot https://github.com/nostra13/Android-Universal-Image-Loader/raw/master/UniversalImageLoader.png in the third picture.
Greets Frank Roth

What about casting view to ImageView and calling getDrawable() ?


Creating an artifact fails if the groupID doesn't exist

CreateArtifact requires a groupID to create an artifact, but accessing /groups/{groupID}/artifacts fails if the group doesn't already exist.
{"message":"RESTEASY003210: Could not find resource for full path: http://localhost:8080/groups/schemaGroupID/artifacts","error_code":404,"detail":"NotFoundException: RESTEASY003210: Could not find resource for full path: http://localhost:8080/groups/schemaGroupID/artifacts","name":"NotFoundException"}
There's no API call available to create a group, and the REST API doesn't have a CreateGroup endpoint documented.

Nevermind, didn't properly append /apis/registry/v2 to the URL.


Recent regression on sandboxed installs as root

Up until recently, root-owned homebrew worked. There appears now to be an issue where the sandboxed brew install can no longer access TLS certificates.
$ sudo /opt/homebrew/bin/brew install pkg-config
==> Using the sandbox
==> Downloading https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.1.tar.gz

curl: (35) SSL certificate problem: Couldn't understand the server certificate format
Trying a mirror…

Compare to non-root-owned:
$ brew install --sandbox --build-from-source pkg-config
==> Using the sandbox
==> Downloading https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.1.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/pkg-config/0.29.1_1 ...

Thanks for spotting the underlying issue: that this is a root problem.
CC @xu-cheng for help with a fix here.
In the mean time: we/I strongly recommend not running Homebrew as root. We don't drop privileges so any random Makefile could sudo rm -rf any file on your machine. Arguably the sandbox is even more important for root-owned Homebrew so I don't think we should disable it there but I'm wondering whether we should support root-owned Homebrew at all until someone who cares about it implements dropping privileges.

I'm trying to bisect to determine the exact location of the problem, but homebrew auto-updating is getting in my way :( It's at least more recent than ed5e2ea3003acc858e0886cb1c4a944f44ba598e

It will be almost certainly https://github.com/Homebrew/brew/pull/713

Ah, of course. Shouldn't this be fixable by allowing the sandbox to read TLS CAs?

Probably. Feel free to beat me or @xu-cheng to a PR.

It looks from https://github.com/Homebrew/brew/issues/785 that the sandbox is trying and failing to write to /private/var/db/mds/system/mds.lock, if that helps.

It looks like the sandbox basically doesn't work as root.

Does the build continue once it's been fetched as a non-root user?

Ah, excellent. Of course, as you said, that's the exact case where you'd want it most.

We'll need to think how we're going to address this as a team. As a workaround you can set HOMEBREW_NO_SANDBOX but I'm increasingly personally tempted to say we just refuse to let Homebrew be run as root until privilege dropping is implemented.

Testing now.

It works as, e.g., the daemon user so this issue appears to be very specific to root.

@Homebrew/maintainers thoughts on how to address this? The two ways I see:

Disable sandbox as root and print a big, fat warning that this is a bad idea
Stop allowing Homebrew to run as root (my preferred option) until someone implements privilege dropping (i.e. the build itself runs as a non-root low-privilege user e.g. nobody)

Stop allowing Homebrew to run as root

this.

I know the Homebrew collective opinion is that the best experience is running Homebrew in /usr/local and changing the permissions so that the brew user can write there without sudo, but I don't want to do that. I have 3rd party binary packages not managed by brew that install into /usr/local. I also compile and install software not controlled by brewinto/usr/local.
Homebrew should support a scenario where Homebrew is not in /usr/local because the brew package manager can't reasonably expect to have exclusive control over the contents of /usr/local. That is why sysV added the concept of /opt for the package manager. It's also decent security to not have the normal unprivileged user account to not have write permission to any directories that are in the $PATH.

Installed /opt/brew
/opt/brew is owned by root:wheel with 755.

It sounds like the ideal thing would be for brew to drop its privileges for downloading packages and tarballs and performing the build when run as root and only use the root privilege for the install step -- but failing that, please don't intentionally break this workflow. Print out a warning if you feel like that is necessary.

I know the Homebrew collective opinion is that the best experience is running Homebrew in /usr/local and changing the permissions so that the brew user can write there without sudo, but I don't want to do that.
Homebrew should support a scenario where Homebrew is not in /usr/local because the brew package manager can't reasonably expect to have exclusive control over the contents of /usr/local.

You can install Homebrew in any location as any user, it's just not our default.

It's also decent security to not have the normal unprivileged user account to not have write permission to any directories that are in the $PATH.
It sounds like the ideal thing would be for brew to drop its privileges for downloading packages and tarballs and performing the build when run as root and only use the root privilege for the install step -- but failing that, please don't intentionally break this workflow. Print out a warning if you feel like that is necessary.

It's terrible, terrible security to have every build-from-source build system running as root. A mistake in (or malicious actor modifying upstream) a single Makefile can do whatever they want to any file on your system. We/I don't trust every upstream to maintain a bug-free and uncompromised build system code and neither should you (which is why we introduced the sandbox).
Privilege dropping will be a non-trivial amount of work that none of the current maintainers will want to implement (we're volunteers working mostly in our spare time and it's low on our list of priorities). If you were able to implement it before I get the change to disable building as root then that would work.

@MikeMcQuaid I agree, the build shouldn't run as root. I didn't realize that brew runs the entire process as root. Homebrew shouldn't do that when run with sudo. MacPorts runs build under the unprivileged macports user context.

@breiter Assuming no code changes: will you personally do anything differently now?

@MikeMcQuaid Well... I recently evaluated Joyent's pkgsrc for OS X. I had some problems with library paths that were annoying but not insurmountable and also libgcrypt-cofig generated garbage that /usr/bin/ld couldn't understand which also was fixable, but the final straw was I couldn't get awscli to work when installed with pip from pkgsrc. So I would think long and hard about going back to MacPorts and just be sad that they aren't integrated with GitHub. (Their Trac system is unlovely.)

Ok so basically "not use Homebrew". FYI you could just use your identical workflow as any non-root user or your choice (say brewuser) and it'll work fine if that brewuser owns the Homebrew installation in /opt and you sudo -u brewuser brew instead of sudo brew.

Stop allowing Homebrew to run as root

Very much in favor of this option!

I'd love Homebrew to have saner root handling in terms of being able to drop privileges as appropriate, although I wouldn't necessarily say MacPorts' mechanism is particularly elegant; I don't mean disrespect to them by that, I add.
I have been meaning to do some thinking about this, but it's really not near the top of my priority list to say the least. Happy to help review any PR to improve our handling on this sort of thing for sure though.

It's also decent security to not have the normal unprivileged user account to not have write permission to any directories that are in the $PATH.

I'm honestly not sure this argument particularly works today. I mean, in theory sure, but npm recommend making their directories user-owned if installing in /usr/local, which is the default for Node's .pkg installer, for example. You also have situations like GOPATH & Perl's local::lib which IIRC can both be set up pretty much anywhere and are both traditionally user-owned.
People consistently favour usability over security, even when you try really really hard to make them favour security. There's a whole bunch of people who would still be using MD5 in Homebrew today if we let them. We've recommended for a long time for people in /usr/local to not force link openssl but a ton of people still did so, because it solved their use case or made finding the desired OpenSSL easier on their project, so we ended up turning that into a hard block.

Disable sandbox as root and print a big, fat warning that this is a bad idea

I'd probably, with some reluctance, go with this.

I'd probably, with some reluctance, go with this.

I don't see how the cost-benefit analysis for that could possibly pay off.

I was reading some producty stuff earlier and I thought the correct answer is both:

Disable sandbox as root and print a big, fat warning that this is a bad idea

We do this for a short while (week/month/3 months) and say that it'll be turned off later.

Stop allowing Homebrew to run as root (my preferred option) until someone implements privilege dropping (i.e. the build itself runs as a non-root low-privilege user e.g. nobody)

We do this after the above warning period.

I don't see how the cost-benefit analysis for that could possibly pay off.

Well, until last week, nobody who wasn't opted-in was using the sandbox. From Homebrew's inception, I believe, people have been able to run brew as root if it is owned by root. It's ultimately less surprising to selectively roll back a week or so for some users than it is several years.

Security flaws we may or may not have had in the past don't justify bad security practices going forward. They are spilt milk.
Being less surprising to some doesn't outweigh possibly compromising others unless our priorities are upside down and backwards.

Lol, the other night you were dead against reproducible bottles despite the obvious security issue around having everyone ultimately trust the CI 🙈.

Ad hominem and non sequitur. Double bonus points.

We do this for a short while (week/month/3 months) and say that it'll be turned off later.

@MikeMcQuaid This seems like overkill, but meh

Ad hominem and non sequitur

Fancy words, but not particularly true on either case. I'm afraid it isn't actually a personal attack if I point out something you said yesterday conflicts with something you said today, and you may have a reason for that that is perfectly valid, but it's reasonable to question why x applies to y but not z.
As for all homebrew/brew things, file a PR or go with whatever the consensus turns out to be.

We do this for a short while (week/month/3 months) and say that it'll be turned off later.

This seems fine, personally. We could include a message that we'll accept a PR within that timeframe to improve Homebrew's root support, perhaps.

@DomT4 @ilovezfs don't make me bang your heads together...

We could include a message that we'll accept a PR within that timeframe to improve Homebrew's root support, perhaps.

👍

@MikeMcQuaid but he started it! :baby:

@ilovezfs and I'll finish it :rage4:

FYI after some digging, if (allow file-write-data (path "/private/var/db/mds/system/mds.lock")) is added in the rule, the bug described in this issue will be fixed. However, I don't know why curl is trying to write this file under root user.

@DomT4

I'm honestly not sure this argument particularly works today. I mean, in theory sure, but npm recommend making their directories user-owned if installing in /usr/local, which is the default for Node's .pkg installer, for example. You also have situations like GOPATH & Perl's local::lib which IIRC can both be set up pretty much anywhere and are both traditionally user-owned.

I think this is a worrying trend and attitude to take. Windows used to be ridiculed for having '.' implicitly in the %PATH% which opened it to all kinds of practical (and to this day) spoofing attacks for both binary hijacking and dll injection.
$GOPATH is a developer workspace, that is a bit of a different thing. If Node is recommending making /usr/local user-owned that is unfortunate. Maybe someone at Joyent -- like Bryan Cantrill -- should look into whether that is really a best practice.
I don't like the idea of a package manager (a) thinking it is OK to take over /usr/local  nor (b) making part of the search path writeable by an unprivileged user.

A short term fix https://github.com/Homebrew/brew/pull/805

I don't like the idea of a package manager (a) thinking it is OK to take over /usr/local nor (b) making part of the search path writeable by an unprivileged user.

You may want to use a different package manager.

(a) thinking it is OK to take over /usr/local

Just to nudge this back further, we don't take it over; nothing about Homebrew actively blocks you from installing other software into /usr/local at the same time.
You can install Homebrew anywhere you like with the exception of / and /usr & we've been actively working on reducing the amount of files we leaves in /usr/local & the level of privilege we need over the whole directory.

However, I don't know why curl is trying to write this file under root user.

It's a sandbox profile, apparently. Unsure at the moment why it doesn't write there when /usr/bin/curl is called without sudo:

clicky
```
;;
;; mds - sandbox profile
;; Copyright (c) 2006-2010 Apple Inc.  All Rights reserved.
;;
;; WARNING: The sandbox rules in this file currently constitute
;; Apple System Private Interface and are subject to change at any time and
;; without notice.

@MikeMcQuaid Since homebrew works as any other nonprivileged user, it seems completely reasonable to deprecate and eventually remove support for root-owned homebrew.

Look I'll say it, yes, there are sec concerns, but not a loot in the world of rootless/sip.
You have no root account.
You have some slightly extended privs to write to a few directories and stuff, but not nearly as much as you think unless you disable SIP.


Full BAS integration test

IT test that deploys program def into target and related scopes checking where it will be installed

Nice!  This is a really cool test, exercises lots of different bits of the modules!


handle additional labels and abbreviations

We only want one rdfs:label per language and the rest as skos:altLabel, is this already covered? If not we could either automatically perform the change for all after the first label (can we change order?) or add an additional column.

order can be changed manually by reordering in the TextField


Fix plan ids provided by bind-service

Coverage increased (+0.01%) to 90.055% when pulling 4c623e8b2ccffe7cb93d656ddf0bd209b0153411 on SAP:fix-broker-plans into 28a21062688bc12046df247cccda471b070292fe on cloudfoundry-incubator:master.

Coverage increased (+0.01%) to 90.055% when pulling 4c623e8b2ccffe7cb93d656ddf0bd209b0153411 on SAP:fix-broker-plans into 28a21062688bc12046df247cccda471b070292fe on cloudfoundry-incubator:master.


Sql edits to instruct_advanced

Modified sql edits to be more accurate according to the questions. This does not affect the final sql output unless otherwise mentioned. Details in comments of commit.

Yay thanks a ton for the eagle eyed edits Wendy!


New Quest: ExpForSaffronQuest

Added leveling fast 40+ to 60
Can heal team with NurseJoy on Seafoam B4F (1500 Money)
Fixed Blackout error

Tested 5 times and work perfectly :)

Tested and worked :+1:


fix check_version requiring minimum python version as 3.7 due to capture_output arg

Adds a fix for https://github.com/muellerzr/dependency_checker/issues/6. This also includes installing specific pip version since the test (assert) validates this. And should fix the CI build

@muellerzr - Added the fix and also few additional changes. Let me know what you think.

Why are we wanting a specific pip version too, along with python? (Sorry, not quite following the correlation here)

Why are we wanting a specific pip version too, along with python? (Sorry, not quite following the correlation here)

@muellerzr - I noticed this where the code is checking for specific pip dependency package. This will fail if someone does not have the same pip version installed.  This is the reason ( I was having pip with a different version and the cell was failing for me).
assert deps == {'pipdeptree':'2.1.0', 'pip':'21.2.4'}

Ah. That's actually an issue with the test I wrote then. That test should be changed to just have pipdeptree. As a specific pip version isn't needed.
As a result, that's a faulty test of mine :)
(Not sure there is a decent way to check for that, will need to think on it)

if you remove the pin, I'll go ahead and merge and fix that test.

That's actually an issue with the test I wrote then. That test should be changed to just have pipdeptree. As a specific pip version isn't needed.
Agreed.

if you remove the pin, I'll go ahead and merge and fix that test.
@muellerzr Yes. Will do and submit a fix.

@muellerzr Changes submitted based on your review comment.


Can't [Retrieving User Details from an Access Token]

1⃣ Request
curl -iX POST
'http://localhost:3005/oauth2/token'
-H 'Accept: application/json'
-H 'Authorization: Basic dHV0b3JpYWwtZGNrci1zaXRlLTAwMDAteHByZXNzd2ViYXBwOnR1dG9yaWFsLWRja3Itc2l0ZS0wMDAwLWNsaWVudHNlY3JldA=='
-H 'Content-Type: application/x-www-form-urlencoded'
--data<EMAIL_ADDRESS>1⃣ Response
HTTP/1.1 200 OK
Content-Security-Policy-Report-Only: default-src *;font-src *;img-src *;script-src *;style-src *;form-action *;base-uri 'self';block-all-mixed-content;frame-ancestors 'self';object-src 'none';script-src-attr 'none';upgrade-insecure-requests
X-DNS-Prefetch-Control: off
Expect-CT: max-age=0
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=15552000; includeSubDomains
X-Download-Options: noopen
X-Content-Type-Options: nosniff
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: no-referrer
X-XSS-Protection: 0
Cache-Control: no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0
Content-Type: application/json; charset=utf-8
Content-Length: 177
ETag: W/"b1-dEvh3fIvHPpfsjT7Lv1vPSlvyMM"
Set-Cookie: session=eyJyZWRpciI6Ii8ifQ==; path=/; expires=Fri, 09 Dec 2022 09:54:05 GMT; httponly
Set-Cookie: session.sig=Ri-h5xOEppsonbO3FRtvV1LbiI0; path=/; expires=Fri, 09 Dec 2022 09:54:05 GMT; httponly
Date: Fri, 09 Dec 2022 08:54:05 GMT
Connection: keep-alive
Keep-Alive: timeout=5
{"access_token":"bdb557638136aa3cefeede95e8f54b2387c4caac","token_type":"bearer","expires_in":3599,"refresh_token":"b06d558efaba5008f0c6c478105ac37c31be57b8","scope":["bearer"]}
2⃣ Request
curl -X GET
'http://localhost:3005/user?access_token=bdb557638136aa3cefeede95e8f54b2387c4caac'
2⃣ Response
"Internal error"
2⃣ container log
.........
{"log":"}\n","stream":"stderr","time":"2022-12-09T08:54:05.75700422Z"}
{"log":"2022-12-09T08:56:32.804Z idm:oauth_controller  --\u003e authenticate_token\n","stream":"stderr","time":"2022-12-09T08:56:32.805070778Z"}
{"log":"2022-12-09T08:56:32.805Z idm:oauth_controller  --\u003e authenticate_bearer\n","stream":"stderr","time":"2022-12-09T08:56:32.805140263Z"}
{"log":"2022-12-09T08:56:32.805Z idm:oauth2-model_oauth_server -------getAccessToken-------\n","stream":"stderr","time":"2022-12-09T08:56:32.805633026Z"}
{"log":"2022-12-09T08:56:32.815Z idm:oauth2-model_oauth_server -------create_oauth_response-------\n","stream":"stderr","time":"2022-12-09T08:56:32.815953537Z"}
{"log":"2022-12-09T08:56:32.817Z idm:oauth2-model_oauth_server -------search_user_info-------\n","stream":"stderr","time":"2022-12-09T08:56:32.817503946Z"}
{"log":"2022-12-09T08:56:32.817Z idm:oauth2-model_oauth_server -------trusted_applications-------\n","stream":"stderr","time":"2022-12-09T08:56:32.817596504Z"}
{"log":"2022-12-09T08:56:32.817Z idm:oauth2-model_oauth_server -------user_roles-------\n","stream":"stderr","time":"2022-12-09T08:56:32.817781913Z"}
{"log":"2022-12-09T08:56:32.819Z idm:oauth2-model_oauth_server Error:  Error: WHERE parameter "oauth_client_id" has invalid "undefined" value\n","stream":"stderr","time":"2022-12-09T08:56:32.819656578Z"}
{"log":"    at MySQLQueryGenerator.whereItemQuery (/opt/fiware-idm/node_modules/sequelize/lib/dialects/abstract/query-generator.js:1658:13)\n","stream":"stderr","time":"2022-12-09T08:56:32.819666142Z"}
{"log":"    at /opt/fiware-idm/node_modules/sequelize/lib/dialects/abstract/query-generator.js:1649:25\n","stream":"stderr","time":"2022-12-09T08:56:32.81966817Z"}
{"log":"    at Array.forEach (\u003canonymous\u003e)\n","stream":"stderr","time":"2022-12-09T08:56:32.819669997Z"}
{"log":"    at MySQLQueryGenerator.whereItemsQuery (/opt/fiware-idm/node_modules/sequelize/lib/dialects/abstract/query-generator.js:1647:35)\n","stream":"stderr","time":"2022-12-09T08:56:32.819671889Z"}
{"log":"    at MySQLQueryGenerator.getWhereConditions (/opt/fiware-idm/node_modules/sequelize/lib/dialects/abstract/query-generator.js:1990:19)\n","stream":"stderr","time":"2022-12-09T08:56:32.819673602Z"}
{"log":"    at MySQLQueryGenerator.selectQuery (/opt/fiware-idm/node_modules/sequelize/lib/dialects/abstract/query-generator.js:932:28)\n","stream":"stderr","time":"2022-12-09T08:56:32.819675302Z"}
{"log":"    at MySQLQueryInterface.select (/opt/fiware-idm/node_modules/sequelize/lib/dialects/abstract/query-interface.js:407:59)\n","stream":"stderr","time":"2022-12-09T08:56:32.81967699Z"}
{"log":"    at Function.findAll (/opt/fiware-idm/node_modules/sequelize/lib/model.js:1134:47)\n","stream":"stderr","time":"2022-12-09T08:56:32.819678649Z"}
{"log":"    at processTicksAndRejections (internal/process/task_queues.js:95:5)\n","stream":"stderr","time":"2022-12-09T08:56:32.819680323Z"}
{"log":"    at async Promise.all (index 0)\n","stream":"stderr","time":"2022-12-09T08:56:32.819681928Z"}
{"log":"2022-12-09T08:56:32.819Z idm:oauth_controller Error  { message: 'Internal error', code: 500, title: 'Internal error' }\n","stream":"stderr","time":"2022-12-09T08:56:32.820609706Z"}
Am I doing something wrong?
I'm looking into the 'js' file, but I don't understand the cause.

I changed the .env file and it worked.
Thank you.

This appears to be a reversion in Keyrock
'http://localhost:3005/user?access_token=bdb557638136aa3cefeede95e8f54b2387c4caac' *FAILS
'http://localhost:3005/user?access_token=bdb557638136aa3cefeede95e8f54b2387c4caac&app_id=tutorial-dckr-site-0000-xpresswebapp' SUCCEEDS
trusted_apps is not working correctly.
I have added a PR here: https://github.com/ging/fiware-idm/pull/306/files#diff-f691da4cc147d46d9035711e2a22a0f552cd822defaf8453f89e708448a3d91f

As a workaround I have updated the API call in the documentation. The Bug Fix has been merged  so will be available as part of the next Keyrock release.


chore(main): release 3.0.1

:robot: I have created a release beep boop
3.0.1 (2024-09-20)
Bug Fixes

src: 'pok end' now waits for the hand to end (81f582b)
src: player removal upon exit (cf247fc)

This PR was generated with Release Please. See documentation.

:robot: Created releases:

v3.0.1
:sunflower:


Garbage Collection does not appear to be observing leap year

Describe the bug
Garbage Collection does not appear to be observing leap year, causing collection dates after February 29, 2020 to show as one day later than they actually should be.
Configuration
YAML or Config Flow (GUI): Config Flow
Frequency: every-n-days
Verbose state: true
First collection month: jan
Last collection month: dec
Collection every n days: 14
First date: 2020-01-06 (a Monday)
No holiday config, extra dates, excluded dates

Expected outcome: The component should show my next collection date at Monday, March 2nd, 2020.
Actual outcome: The component shows my next collection date as Tuesday, March 3rd, 2020.
Error log/debug information
No error logs

Screenshots

Version
HA: 0.105.5
Integration: 2.15

I should also add - I attempted to set this component up as every two weeks instead of every 14 days. It exhibited the same behavior with either configuration.

Weird. I have configured mine exactly the same (starting 2020-01-06, every 14 days)

I do not really work with number of days per month. All I do is, I calculate difference between dates (today-first date), take the remainder of dividing it by the period, and if it is non-zero, calculate the remaining offset and again, use standard python today + timedelta(days=offset)
So I rely on Python to know how many days there is between the dates and that this year is leap year. Could it be that your version of Python handles that differently than mine (I use latest hass.io).

That is strange... I'm running Home Assistant using the official Docker container, which appears to be using Python 3.7.6. I've worked around it for now by deleting and re-creating the configuration for this one, then setting the start date as March 2nd, but still curious as to this behavior.
Looking at your screenshot, I did notice something. Your next date includes a timezone offset. Mine does not, even though my Home Assistant is using the America/Chicago timezone:

I don't know whether that's playing a role, but I suppose it might be possible. Why would your next date show a timezone offset while mine does not?

No idea. I added the timezones in 2.0 I think. It was causing issues in Australia. It works since then. When was testing that, I was trying to change my timezone to Sydney using the location. But that did not work, I did back and forth with people over there to test each change, quite a nightmare. My tz is set right, but do not quite understand how to change it. It could be it takes it from the host OS?

Might be onto something there. I connected to the container running Home Assistant, and it shows the time as UTC. My timezone is set to America/Chicago through the Home Assistant configuration UI.

I think mine is set to UTC too.
➜  /config cat /etc/timezone
Etc/UTC

But in Home Assistant it is set to UTC+1

And it shows it on System Health too

I really don't have an explanation :/
Times seem to convert properly elsewhere in Home Assistant. If I look at States in developer tools, pretty much every time shows as UTC, but it's converted properly in the UI to reflect my local timezone.
I updated my Home Assistant compose file for Docker to include /etc/timezone (before, I was only passing /etc/localtime). It looks like /etc/timezone is set to UTC. However, that didn't seem to make a difference.

Ok, I have tried to change the method of calculating the time difference from standard datetime to dateutil. Since I do not know what is causing it, I have no idea if this will change anything. I have found some posts that it could. Would you like to try? I made a 2.16-beta release with that (you have to show beta under ⁞ . It works for me (makes no difference - it worked before as well). Hopefully it will not break the Aussies.

👏 That seems to have done it! I created a test trash entry, set it to repeat every 14 days, and set the start date as 2020-01-06. It correctly shows the next pickup day as March 2nd, 2020. I also updated my existing recycling entry and put the start date as 2020-01-06, and it is also showing the correct pickup date of March 2nd.


Support for arbitrary $PATH data-loading plugins

Users should be able to put executables on their $PATH that act as arbitrary DataLoaders when opening files with the viewer.

Requires #4494
Requires #4495

Fixed at some point in the DataLoader PR series:

#4516
#4517
#4518
#4519
#4520
#4521
#4565
#4566
#4567


Write a base class for the Policy function

We should write a base class for the Policy function that all participants have to inherit from. That way, we also can have a consistent reference for participants on what their policy functions should provide.
The said class should be well documented (so that the docs show up half decent on Sphinx docs)

RandomPolicy class seems fine, I think we just need them to provide a step function.
Maybe we could also enforce a "pretrained" flag in the init, so that it can be contructed with either pretrained data (Round 1) or without (Round 2).
Just to keep consistency between the two rounds.

@emilio-cartoni : Yes indeed. Thats why I wanted to have a single source of truth for the structure of that class and what interfaces they should expose.
In the examples in the starter kit, we were actually inconsistent about how the step function was being called. In some examples, it was even called as act. So we could avoid that  by having and documenting a base class for the Policy functino.

As per the discussion on the call , we will also include interfaces for the controllers to get a signal when the intrinsic phase begins and ends, and when the individual extrinsic phase trials begin and end.

ef59d8828cc7c1b3c0145e8af60ef1d7ec8e7b2f
Added policy.py file with a Policy class that participants should inherit from.
Now all instances of RandomPolicy inherit from that.
I have also changed evaluate so that it does call those methods.
I have added a test to the test.py so that we also call evaluate when testing (but I have added no assertions).

@emilio-cartoni : I refactored the base policy a little bit, and now they have to defined as follows :
import numpy as np
from real_robots.policy import BasePolicy

class RandomPolicy(BasePolicy):
    def __init__(self, action_space):
        self.action_space = action_space
        self.action = np.zeros(action_space.shape[0])
        self.action += -np.pi*0.5

    def step(self, observation, reward, done):
        self.action += 0.4*np.pi*np.random.randn(self.action_space.shape[0])
        return self.action

This is included from the v0.1.8 release.


Label 89 people + 53 churches

This reduced cases classified as corporations from 33,118
to 5,655, and it reduced RepeatLabelErrors from 11,992 to
3008.
The CMS Physician data set comes from
https://www.healthdata.gov/dataset/physician-compare-national-downloadable-file
via
https://github.com/az0/entity-metadata
Closes https://github.com/datamade/probablepeople/issues/50

This is looking really good @az0. Do you mind merging in changes from master and moving a sample or two from each major pattern over to tests/test_data_labeled.xml for regression tests?

ok

I replaced this with a new PR