Importing module breaks build (create-react-app / webpack)

Prerequisites

[x] I have read the documentation.

Description
import Form from 'react-jsonschema-form' breaks app.
Steps to Reproduce

Initialize new project with create-react-app
Install react-jsonschema-form dependency and use it in the project.
Build/run app (npm start), open in browser to see error: `

Demo project available here: https://github.com/sirreal/broken-react-jsonschema-form
Relevant file: https://github.com/sirreal/broken-react-jsonschema-form/blob/master/src/App.js
The code is copied nearly verbatim from documentation:
import Form from "react-jsonschema-form";
const schema = {
  title: "Todo",
  type: "object",
  required: ["title"],
  properties: {
    title: {type: "string", title: "Title", default: "A new task"},
    done: {type: "boolean", title: "Done?", default: false}
  }
};
/* ... render() ... */
        <Form schema={schema}
          onChange={log("changed")}
          onSubmit={log("submitted")}
          onError={log("errors")}
        />
/* ... */

Expected behavior
See <Form /> component rendered
Actual behavior
App crashes with error:
browser.js:173 Uncaught Error: process.binding is not supported

Version
<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>├──<EMAIL_ADDRESS>└─┬<EMAIL_ADDRESS>  └──<EMAIL_ADDRESS>
node --version
v6.5.0

npm --version
3.10.7

Well, works for me with the same CRA version...

Dunno where to look at to help you further.

I also have no problem on OSX.
I'll try npm cache clean and rebuilding on the other machine tomorrow (Linux).

There is clearly no problem with this module and there is something very strange going on with my machine.
FYI - reinstalling all modules (with npm cache clean) did not help.
Solution: run the same code in a docker container with the same version of node and everything works fine.

Could this be related to https://github.com/facebookincubator/create-react-app/issues/815?

@garudacrafts Yep, that's probably the culprit.

@sirreal Another work around (other than running in a container), would be to identify which node module is falling back to the native copy and add it as a direct dependency in your node_modules. See the latest comments in https://github.com/facebookincubator/create-react-app/issues/1023.

hi i am having the same issue with this package , I  am using
next-Framework 2.0.1
react@latest
npm -v 3.10.10
node -v  6.10.2
how should i resolve it,

@Rajat421 As discussed in #1023, the issue was a system copy of a module was erroneously being used (e.g. in place of the copy installed as a dependency of another module in the project). This ended up happening with more than one module and it wasn't related to react-jsonschema-form or any other particular module.  It was caused by a bug in react and the webpack build process. A workaround was to identify which module was doing this and install it as a direct dependency (simply npm install it to your project). You should be able to identify the culprit by investigating your stack trace.  Another workaround was to unset NODE_PATH as per https://github.com/facebookincubator/create-react-app/issues/1023#issuecomment-264064040. Or you could try to re-install Node.js on your system using another method. But, I'm wondering why you're seeing this issue at all, since it was apparently fixed via https://github.com/facebookincubator/create-react-app/pull/1194. If you're still having problems related to this issue, then I'd suggest you post them there.

If anyone is inquiring, yeah yarn is the same as npm :
 yarn cache clean```
read this: https://yarnpkg.com/lang/en/docs/cli/cache/  .
Has a little bit more info on specific commands and what they do.


SET Single User does not work for SQL Serverless

Trying to run the script from this article against a SQL Serverless DB and I get all these errors:
Msg 15869, Level 16, State 11, Line 34
SINGLE_USER is not supported for ALTER DATABASE.
Msg 15869, Level 16, State 11, Line 37
READ_ONLY is not supported for ALTER DATABASE.
Msg 15869, Level 16, State 11, Line 40
MULTI_USER is not supported for ALTER DATABASE.
Is there a SQL Serverless version of this? I am trying to run the following:
alter database current collate Latin1_General_100_BIN2_UTF8
And get the error:
Msg 5030, Level 16, State 5, Line 5
The database [DBNAME] could not be exclusively locked to perform the operation.
Msg 5072, Level 16, State 1, Line 5
ALTER DATABASE failed. The default collation of database '[DBNAME]' cannot be set to Latin1_General_100_BIN2_UTF8.

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

ID: b67ab534-229d-f12a-6216-9550d790ea42
Version Independent ID: 529e1ec2-00c5-9c13-1a75-dfc183765aff
Content: Set a database to single-user mode - SQL Server
Content Source: docs/relational-databases/databases/set-a-database-to-single-user-mode.md
Service: sql
Sub-service: ****
GitHub Login: @WilliamDAssafMSFT
Microsoft Alias: wiassaf

Hi @dbszepesi! This article applies to SQL Server, which does not include pools in Azure Synapse. The available ALTER DATABASE syntax options for Azure Synapse are provided here: https://learn.microsoft.com/sql/t-sql/statements/alter-database-transact-sql?view=azure-sqldw-latest&preserve-view=true&tabs=sqlpool

Thanks for the quick response. The article is tagged as for all SQL versions, I guess that does not explicitly mean Synapse?
Applies to:  SQL Server (all supported versions)


Add Privacy Text to Disclaimer Page

Add the following text to the Disclaimer Page. Change the Disclaimer Link to "Disclaimer, Terms and Privacy"
By providing your personal information, you consent to making such information accessible to persons who visit this website. You further acknowledge and agree that in order to serve the specific purposes for which personal information is volunteered by you, such information needs to be accessible to the public at large and therefore, by volunteering your information on this website, you consent to making such information public. By providing your phone number and email address, you further consent to being contacted by anyone who accesses such information through this website. The creators of this website or the government of Kerala shall not be liable for any unauthorized use, misuse or sharing of such information.
On the volunteer signup screen, add a checkbox with the text that says "I agree to terms & conditions of keralarescue.in " - Add a link on "terms & conditions" to the disclaimer page.

working on it.
which is the html file for volunteer signup screen,

This issue is closed.

Unable to push updates

I see the updates now


Make certain string ops robust to NULL arguments.

We're getting crashes, very hard to reproduce so I'm not 100% sure this is related, but there is circumstantial evidence that the crash happens inside osl_endswith_iss. Looking at the code, I can see how NULL arguments could be trouble to this and some related functions, so I'm beefing up handling of those cases.

LGTM

Cross fingers that it is the source of my doesn't-fail-in-the-debugger problem. :-)


Implications of receiving a bogus block locator

When we receive GetHeadersPayload we try to find fork using block locators. Explore the implications of sending 32mb of rubbish as a block locator.

Is this not resolved by #2094? @dangershony
And then #2124 also adds some additional protection I think - they mention the message size earlier on in the thread, referring to altcoins that are (were) still on 32mb.


Feature: Supporting TypeScript

Feature request
You should be able to:

Use TypeScript in <script> block in Vue component
Use .ts pages and import .ts files in app runtime
Use saber-config.ts (maybe)
Use saber-node.ts (maybe)

This should be implemented as a plugin (unless it doesn't introduce any large dependencies).

There is a $100.00 open bounty on this issue. Add more on Issuehunt.

Checkout the Issuehunt explorer to discover more funded issues.
Need some help from other developers? Add your repositories on Issuehunt to raise funds.

@issuehunt has funded $100.00 to this issue.

Submit pull request via IssueHunt to receive this reward.
Want to contribute? Chip in to this issue via IssueHunt.
Checkout the IssueHunt Issue Explorer to see more funded issues.
Need help from developers? Add your repository on IssueHunt to raise funds.

No need for saber-config.ts and saber-node.ts this will just make things complicated

No need for saber-config.ts and saber-node.ts this will just make things complicated

Using ts-node it should be pretty easy, don't know how involved the implementation would be in real life. From glancing at the docs it looks straightforward though.

Yeah, at least we should add support for using TypeScript in pages.

Is this issue still open to new pull request?


DataWriter.SetHeader() is only called through TypeNegotiator

It seem setting a data writer through Context.SetDataWriter() doesn't make Context.Write call the SetHeader()
I suppose that is a bug since (to be symmetric) Context.Read() does take the Content-Type header into account.

Thanks!


Fix: handle file exists check exception

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

21 of 43 (48.84%)  changed or added relevant lines in 2 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage decreased (-0.7%) to 78.295%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

charon/pkgs/maven.py
8
14
57.14%

charon/storage.py
13
29
44.83%

Totals

Change from base Build<PHONE_NUMBER>:
-0.7%

Covered Lines:
1414

Relevant Lines:
1806

💛  - Coveralls


Add ops: noop, array, concat; change identity signature

I've expressed everything in strings for now. Maybe it makes sense to go golang-style?
like
identity_s(s: ?string) -> ?string
identity_u8(u: ?u8) -> ?u8
identity_u32(u: ?u32) -> ?u32

array_2(a: string, b: string, c: string) -> []string
array_3(a: string, b: string, c: string) -> []string
array_4(a: string, b: string, c: string, d: string) -> []string
array_5(a: string, b: string, c: string, d: string, e: string) -> []string

concat_2(a: []string, b: []string) -> []string
concat_3(a: []string, b: []string, c: []string) -> []string

and so on

Seems like we need generics :)

I don't understand how you can cast an array to a string... How should it be represented in aqua code?

Until we have variance in Aqua, please keep it as it is.


Failed to Fetch

Hi! i´m having problems to use the ollama rivet plug in, can somebody helpme?

I'm facing the same issue. Using Windows from Postman, Thunderclient ... this request is working well: GET http://localhost:11434/api/tags but trying from Rivet is getting a 403 error: [GIN] 2024/05/31 - 19:05:58 | 403 |            0s |       <IP_ADDRESS> | GET      "/api/tags"

Fixed thanks people in Discord. In my case with Windows and Powershell I have started Ollama with:
$env:OLLAMA_ORIGINS="*"  ollama start


Error with private variable setters in mixins on dart web.

dart --version 2.19.0-266.0.dev, also on stable / beta channels
web / chrome
Very similar issue to https://github.com/dart-lang/sdk/issues/44636.
Simplest reproduction so far:
Edit: See @schultek's minimum sample below for a simpler reproduction.

dart create -t web-simple call_stack_overflow && cd call_stack_overflow
Replace main with the following

import 'dart:html';
import 'package:riverpod/riverpod.dart';

void main() {
  final container = ProviderContainer();
  final value = container.read(stringValue.state);
  querySelector('#output')?.text = 'Your ${value.state} app is running.';
}

final stringValue = StateProvider.autoDispose((ref) => 'Hello world');

Add Riverpod to pubspec with riverpod: ^2.0.0
Run sample with webdev serve
Visit web app and check the console.

Stack overflow on private setter in a mixin. Making the field in the package public shifts the error to another private member.
 .......
    at set [_keepAliveLinks] (auto_dispose.dart:42:7)
    at set [_keepAliveLinks] (auto_dispose.dart:42:7)
    at set [_keepAliveLinks] (auto_dispose.dart:42:7)
    at AutoDisposeProviderElementMixin.<computed> (auto_dispose.dart:6:24)
    at StateProviderElement_AutoDisposeProviderElementMixin$36.__ (base.dart:81:48)
    at new AutoDisposeStateProviderElement.__ (auto_dispose.dart:42:7)
    at AutoDisposeStateProvider.new.createElement (auto_dispose.dart:31:44)
    at [_create] (container.dart:49:32)
    at framework._StateReader.new.getElement (container.dart:41:52)
    at container.dart:434:37
    at framework.ProviderContainer.new.readProviderElement (container.dart:466:14)
    at ProviderElementProxy.new.read (proxy_provider_listenable.dart:112:25)
    at framework.ProviderContainer.new.read (container.dart:257:20)
    at main$ (main.dart:25:26)
    at main.dart.bootstrap.js:273:10
    at Array.forEach (<anonymous>)
    at window.$dartRunMain (main.dart.bootstrap.js:272:32)
    at <anonymous>:1:8
    at Object.runMain (client.js:8777:21)

Originally reported here: https://github.com/rrousselGit/riverpod/issues/1713
I tried creating a more minimal sample, but was unsuccessful.

Same error doesn't exist with dart compile js

Here is a minimal reproducible snippet without riverpod (using the web-simple template):
// main.dart
import 'baz.dart';

void main() {
  var foo = Foo();
  print(foo.bar());
}

class Foo = Bar with Baz;
class Bar {}

// baz.dart
mixin Baz {
  int? _foo;

  void bar() {
    _foo = 100;
  }
}

The error happens only, when the Baz mixin is defined in a different library than Foo.

Any update on this ?!

This seems very similar to #44636, if that's of any use.

I'm "engaging" with the engineers now. Thanks for your patience!

Upvoting this because this is a blocking issue with a client.

I narrowed down a little more from @schultek's example.
So basically, the issue occurs with this syntax when it's used with Mixin: class Foo = Bar with Baz
// main.dart
import 'baz.dart';

void main() {
  var foo = Foo();
  var fooWork = FooWork();
  fooWork.bar();
  foo.bar();
}

class Foo = Bar with Baz; // crash
class FooWork extends Bar with Baz{} // doesn't crash

class Bar {}

// baz.dart
mixin Baz {
  int? _foo;

  void bar() {
    _foo = 100;
  }
}

@kevmoo yep. It's tested and merged in the main, but I wish it to be fixed from dart anyway. I think the syntax makes the code cleaner. Not sure how widespread the syntax is, but maybe there are many packages impacted by this issue.

Also, it'd be nice for that syntax to also be documented somewhere.  The first I saw it was in the RiverPod code, and Remi claims that he found it by going through the compiler sources. :)

Thank you @TimWhiting and other for reporting the issue and providing a great repro!  I am looking into this currently, apologies for the delay.
Maybe related: https://github.com/dart-lang/sdk/issues/46867
Looks like this is the culprit DDC-generated code that causes the stack overflow. Will see how it can be fixed:
class AutoDisposeFutureProviderElement extends FutureProviderElement_AutoDisposeProviderElementMixin$36 {
      static ['_#_#tearOff'](T, provider) {
        return new (future_provider.AutoDisposeFutureProviderElement$(T)).__(provider);
      }
      get [_keepAliveLinks]() {
        return this[_keepAliveLinks]; // Calling itself here!
      }
      set [_keepAliveLinks](value) {
        return this[_keepAliveLinks] = value;
      }
      get [_maintainState]() {
        return this[_maintainState];
      }
      set [_maintainState](value) {
        return this[_maintainState] = value;
      }
      get maintainState() {
        return super.maintainState;
      }
      set maintainState(value) {
        return super.maintainState = value;
      }
      keepAlive() {
        return super.keepAlive();
      }
      mayNeedDispose() {
        return super.mayNeedDispose();
      }
      runOnDispose() {
        return super.runOnDispose();
      }
    }

@leehack thanks you for the great repro! Here is where the fault lies. I'll post updates on my progress.
main.dart.lib.js from @leehack 's example

/// Generated by DDC, the Dart Development Compiler (to JavaScript).
// Version: 2.19.0-319.0.dev (dev) (Tue Oct 18 17:25:31 2022 -0700) on "macos_x64"
// Module: packages/hello_world/main.dart
// Flags: soundNullSafety(true), enableAsserts(true)
define(['dart_sdk', 'packages/hello_world/baz.dart'], (function load__packages__hello_world__main_dart(dart_sdk, packages__hello_world__baz$46dart) {
  'use strict';
  const core = dart_sdk.core;
  const dart = dart_sdk.dart;
  const dartx = dart_sdk.dartx;
  const baz = packages__hello_world__baz$46dart.baz;
  var main = Object.create(dart.library);
  dart._checkModuleNullSafetyMode(true);
  dart._checkModuleRuntimeTypes(false);
  const CT = Object.create({
    _: () => (C, CT)
  });
  var I = ["package:hello_world/main.dart"];
  var _foo = dart.privateName(baz, "_foo");
  main.Bar = class Bar extends core.Object {
    static ['_#new#tearOff']() {
      return new main.Bar.new();
    }
  };
  (main.Bar.new = function() {
    ;
  }).prototype = main.Bar.prototype;
  dart.addTypeTests(main.Bar);
  dart.addTypeCaches(main.Bar);
  dart.setLibraryUri(main.Bar, I[0]);
  const Bar_Baz$36 = class Bar_Baz extends main.Bar {};
  (Bar_Baz$36.new = function() {
    baz.Baz[dart.mixinNew].call(this);
  }).prototype = Bar_Baz$36.prototype;
  dart.applyMixin(Bar_Baz$36, baz.Baz);
  main.Foo = class Foo extends Bar_Baz$36 {
    static ['_#new#tearOff']() {
      return new main.Foo.new();
    }
    get [_foo]() {
      return this[_foo];
    }
    set [_foo](value) {
      return this[_foo] = value; // CALLS ITSELF!
    }
    bar() {
      return super.bar();
    }
  };
  (main.Foo.new = function() {
    main.Foo.__proto__.new.call(this);
    ;
  }).prototype = main.Foo.prototype;
  dart.addTypeTests(main.Foo);
  dart.addTypeCaches(main.Foo);
  dart.setMethodSignature(main.Foo, () => ({
    __proto__: dart.getMethods(main.Foo.__proto__),
    bar: dart.fnType(dart.void, [])
  }));
  dart.setGetterSignature(main.Foo, () => ({
    __proto__: dart.getGetters(main.Foo.__proto__),
    [_foo]: dart.nullable(core.int)
  }));
  dart.setSetterSignature(main.Foo, () => ({
    __proto__: dart.getSetters(main.Foo.__proto__),
    [_foo]: dart.nullable(core.int)
  }));
  dart.setLibraryUri(main.Foo, I[0]);
  const Bar_Baz$36$ = class Bar_Baz extends main.Bar {};
  (Bar_Baz$36$.new = function() {
    baz.Baz[dart.mixinNew].call(this);
  }).prototype = Bar_Baz$36$.prototype;
  dart.applyMixin(Bar_Baz$36$, baz.Baz);
  main.FooWork = class FooWork extends Bar_Baz$36$ {
    static ['_#new#tearOff']() {
      return new main.FooWork.new();
    }
  };
  (main.FooWork.new = function() {
    main.FooWork.__proto__.new.call(this);
    ;
  }).prototype = main.FooWork.prototype;
  dart.addTypeTests(main.FooWork);
  dart.addTypeCaches(main.FooWork);
  dart.setLibraryUri(main.FooWork, I[0]);
  main.main = function main$() {
    let foo = new main.Foo.new();
    let fooWork = new main.FooWork.new();
    fooWork.bar();
    foo.bar();
  };
  dart.trackLibraries("packages/hello_world/main.dart", {
    "package:hello_world/main.dart": main
  }, {
  }, '{"version":3,"sourceRoot":"","sources":["main.dart"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAkBW;;;;;;;;;;;;;;AAHL;;;+BAAK;;;AAAL;;;;;;EAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EACW;;;;;AAP7B,cAAM;AACN,kBAAU;AACD,IAAb,AAAQ,OAAD;AACE,IAAT,AAAI,GAAD;EACL","file":"../../../../../../../../packages/hello_world/main.dart.lib.js"}');
  // Exports:
  return {
    main: main
  };
}));

//# sourceMappingURL=main.dart.lib.js.map

Update: found the culprit - we haven't marked the mixin declaration class fields as virtual, so overrides were not working correctly. Testing out the fix currently.

Will this get included in a hotfix release of Dart and Flutter? It's quite a serious issue. I myself ran into it in my large Flutter app that does not use Provider.

@hacker1024 I am working on it, will update on if and when!


Service Tier doesn't exist / is not installed

Getting "Service Tier doesn't exist / is not installed" causing New-BCContainerHelper to stop
Creation script;
$containerName = 'bcsandbox'
$password = 'P@ssw0rd'
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$credential = New-Object pscredential 'admin', $securePassword
$auth = 'UserPassword'
$artifactUrl = Get-BcArtifactUrl -type 'Sandbox' -version '17.5.22499.23473' -country 'gb' -select 'Closest'
New-BcContainer `
    -accept_eula `
    -containerName $containerName `
    -credential $credential `
    -auth $auth `
    -artifactUrl $artifactUrl `
    -updateHosts

Output;
BcContainerHelper is version 2.0.9
BcContainerHelper is not running as administrator
Host is Microsoft Windows 10 Enterprise - 20H2
Docker Client Version is 20.10.5
Docker Server Version is 20.10.5
Removing container bcsandbox
Removing C:\ProgramData\BcContainerHelper\Extensions\bcsandbox
Fetching all docker images
Fetching all docker volumes
Using image mcr.microsoft.com/businesscentral:10.0.19042.804
Creating Container bcsandbox
Version: 17.5.22499.23473-GB
Style: sandbox
Multitenant: Yes
Platform: 17.0.22463.23443
Generic Tag: <IP_ADDRESS>
Container OS Version: 10.0.19042.804 (20H2)
Host OS Version: 10.0.19042.804 (20H2)
Using process isolation
Using locale en-GB
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Files in C:\ProgramData\BcContainerHelper\Extensions\bcsandbox\my:
- AdditionalOutput.ps1
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bcsandbox from image mcr.microsoft.com/businesscentral:10.0.19042.804
5cdd11ea7b06917ffa012be0d8fcfeb089ae5fc1f247f6c2d103bd49529c0bbf
Waiting for container bcsandbox to be ready
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/17.5.22499.23473/gb
Using installer from C:\Run\150-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
Copying PowerShell Scripts
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\17.5.22499.23473\gb\BusinessCentral-GB.bak
Restoring CRONUS Demo Database
Setting CompatibilityLevel for tenant on localhost\SQLEXPRESS
Exporting Application to CRONUS
Initializing...
Setting host.docker.internal to <IP_ADDRESS> in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to <IP_ADDRESS> in container hosts file (copy from host hosts file)
Setting kubernetes.docker.internal to <IP_ADDRESS> in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to <IP_ADDRESS> in container hosts file
Starting Container
Hostname is bcsandbox
PublicDnsName is bcsandbox
Using NavUserPassword Authentication
Starting Local SQL Server
Starting Internet Information Server
Creating Self Signed Certificate
Self Signed Certificate Thumbprint AB1F321E334CDA9B7B0C5E0050E26B1601ACD517
Modifying Service Tier Config File with Instance Specific Settings
Service Tier doesn't exist / is not installed
at <ScriptBlock>, C:\Run\navstart.ps1: line 152
at <ScriptBlock>, C:\Run\start.ps1: line 363
at <ScriptBlock>, <No file>: line 1Error
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/17.5.22499.23473/gb
Using installer from C:\Run\150-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
Copying PowerShell Scripts
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\17.5.22499.23473\gb\BusinessCentral-GB.bak
Restoring CRONUS Demo Database
Setting CompatibilityLevel for tenant on localhost\SQLEXPRESS
Exporting Application to CRONUS
Initializing...
Setting host.docker.internal to <IP_ADDRESS> in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to <IP_ADDRESS> in container hosts file (copy from host hosts file)
Setting kubernetes.docker.internal to <IP_ADDRESS> in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to <IP_ADDRESS> in container hosts file
Starting Container
Hostname is bcsandbox
PublicDnsName is bcsandbox
Using NavUserPassword Authentication
Starting Local SQL Server
Starting Internet Information Server
Creating Self Signed Certificate
Self Signed Certificate Thumbprint AB1F321E334CDA9B7B0C5E0050E26B1601ACD517
Modifying Service Tier Config File with Instance Specific Settings
Service Tier doesn't exist / is not installed
at <ScriptBlock>, C:\Run\navstart.ps1: line 152
at <ScriptBlock>, C:\Run\start.ps1: line 363
at <ScriptBlock>, <No file>: line 1
Initialization of container bcsandbox failed
OBFUSCATED\Documents\WindowsPowerShell\Modules\BcContainerHelper\2.0.9\ContainerHandling\Wait-NavContainerReady.ps1:43 char:17
+ ...             throw "Initialization of container $containerName failed" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Initialization ...csandbox failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Initialization of container bcsandbox failed

This was working until today.

Script is fine.
Could you try to download the event log from the container (get-bccontainereventlog)

It contains a lot of SQL Express informational but only four errors.
The first is powershell.exe faulting;
Faulting application name: powershell.exe, version: 10.0.19041.546, time stamp: 0x7eda4115
Faulting module name: ntdll.dll, version: 10.0.19041.804, time stamp: 0x4544b4a1
I extrapolate that to mean that my something is corrupt.  I will try a purge of everything I can think of and try again.
Thanks for your speedy advice.


Scrolling over sortable elements doesn't work on Phones and Tablets on examples

I think this is not device specific issue, but here is a list of devices I used for testing:

Iphone 6S
Nexus 6P
Ipad 4 6.0
Tested on provided examples.
1 Go to http://clauderic.github.io/react-sortable-hoc/#/basic-configuration/basic-usage
2 Scroll the list
Actual result:
It drags and moves an item but doesn't scroll the list

Maybe it's by design since the Activate onPress (200ms) works as expected.

@Rask777 it works fine for me, just make sure you scroll the actual browser window down a little, as the list overflows a little on smaller screens. Tested on iOS safari/chrome and Android chrome

well, maybe it's the ios version problem? it does not work well for me on ios11 safari and chrome
https://github.com/clauderic/react-sortable-hoc/issues/304

#304


Fileinfo is missing in NFO export which lead to partially working Kodi library

Bug report
Your Environment

Netflix add-on version: 1.2.0
Operating system version/name: Arch Linux
Device model:  Intel NUC

Used Operating system:

[ ] Android
[ ] iOS
[X] Linux
[ ] OSX
[ ] Raspberry-Pi
[ ] Windows

Describe the bug
When exporting a series to Kodi library with enabled NFO export including all details, it doesn't export <fileinfo> to the NFO file. Without it the Kodi library didn't show any tags or small images like HD/SD.
Expected behavior
The fileinfo information should be exported, eg:
<fileinfo>
   <streamdetails>
       <audio>
           <channels>2</channels>
           <codec>aac</codec>
       </audio>
       <video>
           <codec>h264</codec>
           <durationinseconds>120</durationinseconds>
           <height>1080</height>
           <width>1920</width>
           <language>ger</language>
           <scantype>Progressive</scantype>
       </video>
   </streamdetails>
</fileinfo>

Actual behavior
Due to absence of fileinfo, some information in Kodi library is missing.
Steps to reproduce the behavior

Navigate to Netflix library settings
Activate export of NFO files
Always for movies and series
Enable setting to export all NFO information

Possible fix
Export <fileinfo>, for example like the Amazon Prime plugin does.

this is not a bug report, but rather a implementation request
will be queued up with the others

i have re-analyzing the metadata used to generate nfo
but there are no info to allow add stream details
so your request is not applicable


Exclude all files in acceptance test directory

Resolves #2186 by expanding the rubocop exclusions for the acceptance test directory.

Codecov Report

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

@@            Coverage Diff            @@
##             master    #2188   +/-   ##
=========================================
  Coverage     86.86%   86.86%
  Complexity     5139     5139
=========================================
  Files           456      456
  Lines         20386    20386
  Branches       2184     2184
=========================================
  Hits          17708    17708
  Misses         1908     1908
  Partials        770      770

Continue to review full report at Codecov.

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


[Question] Token cache returns unintended auth token

Hello, I just want to clarify the following scenario for the mssql-jdbc driver:
            IClientCredential credential = ClientCredentialFactory.createFromSecret(entraPrincipalSecret);
            ConfidentialClientApplication clientApplication = ConfidentialClientApplication
                    .builder(aadPrincipalID, credential).executorService(executorService)
                    .setTokenCacheAccessAspect(PersistentTokenCacheAccessAspect.getInstance())
                    .authority(fedAuthInfo.stsurl).build();

So, in the above code for the mssql-jdbc driver, we use the persistent token cache to cache the auth token. If the driver makes a successful initial connection using a valid initial entra principal service ID and entra principal secret, an auth token is appropriately cached. However, for example, on a subsequent connection after the first, if I use a valid entra principal service ID, but an invalid entra principal secret I successfully auth because of the prior cached auth token. Is this scenario expected? I assume because the entra principal secret has changed, should the token in the cache be invalidated and so in my described scenario I should fail in subsequent connections?
Example below to further to clarify:

Use valid entra principal service ID and entra principal secret in auth
Successfully auth, and cache auth token,
Attempt a subsequent auth with a valid entra principal service ID, but invalid entra principal secret
Successfully auth because of prior cached auth token even though an invalid entra principal secret was set

For step 4, is this expected? I expected since the secret changed, the token in the cache should be invalidated and so the auth should fail.

This is the expected behavior indeed. MSAL libraries do not associate credentails (e.g. secret) and tokens. Once a client has obtained a token, it can use it for its lifetime. Credentials are only checked by the STS for validity.
This is important because the lifetime of credentials can be lower than the lifetime of tokens. There are cases where credentials are rotated every 30 min, but tokens are valid 24h +.. Clients should not make new requests to the STS just because the credentials have been rotated.
From our point of view, if a client managed to get a token, it can anyway cache it on its own and reuse it, so there's no security in associating a token with a cred.
If you need to create this association yourself, then we recommend that you maintain a map of [secret] -> [confidential_client_application] objects. Make sure the CCA objects do not point to the same cache of course.

Thanks for the clear explanation. This ticket can be closed.


k-space conversion c-axis input field only allows a max value of 10 Angstrom

Used wrong issue number in a commit, but it's closed.


C# V7: Generalized async return types

Questions re 14.15 Async Functions|14.15.1 General:
A. Re System.Runtime.CompilerServices.AsyncMethodBuilder, in the absence of a CLI spec update, presumably, we’ll need to spec this attribute type. Or at least update §C.3, “Standard Library Types not defined in ISO/IEC 23271” to include this new Attribute type.
B. §<IP_ADDRESS>, “Awaitable expressions,” allows for the possibility of the awaiter implementing ICriticalNotifyCompletion. What, if anything, should we say about awaiter/builder types being required/permitted to implement ICriticalNotifyCompletion?
Bill W.: Maybe. We (the ECMA committee) stuck with just INotifyCompletion. As such, this may be an implementation detail. Let’s discuss in committee.
C. Where are the semantics of the TaskBuilderType methods defined? Is there some sort of IBuilderMembers interface that an awaiter should implement, or does the awaiter simply have to declare each of those members?
Bill W.: My first thought is to follow the example of LINQ query expressions: A type must follow a “shape”, but what those methods actually do isn’t spelled out in detail in the spec.
D. Is there some spec for the V6 state-machine code generation for Task and Task<T> that I can adapt for all task types?
Bill W. I don’t think so, but from my comment above, we may not need to add this.
E: In which section should the spec for state-machine code generation go? In the async-return spec it’s listed under “Execution.”
Bill W. Do you think we need something like this: §12.17.3 Query expression translation? That’s my first thought.
General question:
F. How/where do I merge in the text from the async-return spec section “Overload Resolution?” Maybe in <IP_ADDRESS>, “Exactly matching expression.”
@gafter On yesterday's TG2 call you said you'd like to run this PR by an expert. I've spec'd all that I can for this feature, and listed the open issues above.

I've asked @ljw1004 to look at this.

See #345 for more questions on this feature

link to feature speclet

Re System.Runtime.CompilerServices.AsyncMethodBuilder, in the absence of a CLI spec update, presumably, we’ll need to spec this attribute type. Or at least update §C.3, “Standard Library Types not defined in ISO/IEC 23271” to include this new Attribute type.

I added the declarations in §C.3 for System.Runtime.CompilerServices.AsyncMethodBuilder.

§<IP_ADDRESS>, “Awaitable expressions,” allows for the possibility of the awaiter implementing ICriticalNotifyCompletion. What, if anything, should we say about awaiter/builder types being required/permitted to implement ICriticalNotifyCompletion?

C. Where are the semantics of the TaskBuilderType methods defined? Is there some sort of IBuilderMembers interface that an awaiter should implement, or does the awaiter simply have to declare each of those members?

D. Is there some spec for the V6 state-machine code generation for Task and Task that I can adapt for all task types?
E: In which section should the spec for state-machine code generation go? In the async-return spec it’s listed under “Execution.”

I addressed all of these by adding the text for the semantics of the TaskBuilderType members. There isn't an interface, but the compiler expects certain semantics.  That text is in a new clause under §14.15. It specifies what calls the compiler generates to create an instance of the builder type and what methods will be  called for that builder type.

F. How/where do I merge in the text from the async-return spec section “Overload Resolution?” Maybe in <IP_ADDRESS>, “Exactly matching expression.”

I added the first rule to "Exactly matching expression". The second and third I added to "Better conversion target".

No further comments for any invited reviewers.
@jskeet  Can we look at this one for the upcoming meeting as well?

Yup, absolutely. Please add the label - it's fiddly to do on my phone...

@jskeet Async return types is rebased and ready for the upcoming meeting.

Approved on 2023-05-17 meeting.


is it possible to send contact request to other client with this library?

can you give me snippet of code?

It is not possible yet

This should be closed with one of the recent commits, right?

Contact#sendRequest()
Contact#authorize()
Contact#unauthorize()
Contact#block()
Contact#unblock()

Tiny tweak, but maybe change #authorize to #accept and #unauthorize to #decline to make it clearer that it accepts or declines the contact?

It doesn't make sense to 'decline' a contact whom you've already authorized

Ah, so it's the same request when deleting a contact then?

Yes


Release 0.0.22 contains a type error on blockstore-level.d.ts

The current released package doesn't work without manual editing the type definition for blockstore-level.d.ts.
It was fixed in the commit right after the latest release, so this will be fixed on next release, but consider releasing it soon so the package works again:

I just released v0.0.23, hopefully that addresses the issue!

Thanks, fixed this issue!


Showing Docker pulls

Codecov Report

Merging #66 into master will decrease coverage by 2.92%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master      #66      +/-   ##
==========================================
- Coverage   64.87%   61.95%   -2.93%
==========================================
  Files           3        3
  Lines         205      205
==========================================
- Hits          133      127       -6
- Misses         62       68       +6
  Partials       10       10

Impacted Files
Coverage Δ

main.go
41.33% <0%> (-8%)
:arrow_down:

Continue to review full report at Codecov.

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


Create sjb-liege.txt

Institution/School Name
Institut Saint-Jean Berchmans Liège
Instiution/School Website
https://www.saint-jean-berchmans.be/
Email Users
<EMAIL_ADDRESS>only a few teachers can add users, nobody can register himself.
new users are added every year (if new in school, or if someone comes in the middle of the year)
Please place an x between the square brackets if yes

[x] Students
[x] Academic/Teaching Staff
[ ] Other/Support Staff
[ ] Alumni

Education Levels
Please place an x between the square brackets if yes

[ ] Post-graduate research
[x] Graduate School
[ ] College (University) or Undergraduate School or equivalent
[x] Community College or equivalent
[x] High School or equivalent
[ ] Elementary School or equivalent

@roscale Pull request merged. Thank you!

How long does it take to allow the email ? 1 day ? 48 hours ?


Provide some spacchetti package management commands

See https://github.com/justinwoo/spacchetti/issues/16

Personally, I am very happy using my Perl scripts, but someone may want to implement some of these in this CLI.

Just gave it a quick try, and thought about some things that would be nice:

A add-package command that adds packages to psc-package.json
A add-from-bower command that appends new packages in packages.dhall, and then calls add-package
A clear-cache command that deletes .psc-packages, or install that deltes the folder and runs psc-package install afterwards.
Deal somehow with an existing project's psc-package.json. If it's unreasonable to pickup the settings, at least abort with an error message.

If they sound reasonable to you, I can open them as separate issues and start working on them.

@justinwoo
Upgrading an existing project is probably more annoying than what I initially thought.
With all the possible combinations of existing .psc-package.json, packages.dhall and --force I feel like it would be giving the user false expectations that things will just work.
Maybe the best thing is to remove .psc-package.json from the files checked by local-setup, and just "upgrade" it with  jq '. + { set: "local", source: ""}'.
This can lead to a broken setup if one of the packages is not in the default spacchetti repo, but we could just print a warning message.

Sounds fine, though probably we want to not just call jq in reality. Wonder how much aeson would add to the build times/size compared to any other solution for JSON


Loading from S3 into Redshift Cluster in Private Subnet

Use Case
When you have Redshift Cluster provisioned in Private Subnet, you cannot load the data from S3 directly.
Proposed Solution
I propose to use Lambda Function provisioned inside private subnet to load data from S3 Bucket using S3 Event mechanism.
Please find attached Architecture diagram as well as proposed Lambda Function package.

I believe this can be accomplished with current with the current aws-s3-lambda construct. When you specify lambdaFunctionProps for the s3-lambda construct, specify a vpc:
import { S3ToLambdaProps, S3ToLambda } from '@aws-solutions-constructs/aws-s3-lambda';

const existingVpc = Vpc.fromVpcAttributes( /* enough info to find VPC */);

new S3ToLambda(this, 'test-s3-lambda', {
    lambdaFunctionProps: {
        code: lambda.Code.fromAsset(`${__dirname}/lambda`),
        runtime: lambda.Runtime.NODEJS_12_X,
        handler: 'index.handler',
        vpc: existingVpc
    },
});

(did this off the top of my head, please excuse syntax issues) This will allow your Lambda function to access resources in the VPC.

Not sure I understand your comment. The solution I am proposing is end-to-end to allow users to load s3 data into Redshift Cluster provisioned in private subnet. Are you saying, we have this lambda construct already? I don't see that in the list.

salunkhesl@ Are you proposing the constructs will provision the Redshift resources/permissions in addition to lambda ? If so, we don't have aws-lambda-redshift construct in the library. We could then plug that with the existing aws-kinesisfirehose-s3 and aws-s3-lambda constructs to create the expected architecture you proposed.

salunkhesl@ Are you proposing the constructs will provision the Redshift resources/permissions in addition to lambda ? If so, we don't have aws-lambda-redshift construct in the library. We could then plug that with the existing aws-kinesisfirehose-s3 and aws-s3-lambda constructs to create the expected architecture you proposed.

Yes, I intend to provide E2E solution to load into RD cluster in Private subnet. We could use existing constructs or I will simply create CFN including all the components.

An end to end solution built on other constructs or including CFN doesn't sound like a Solutions Construct. Our goal would be to publish small reusable blocks that you could use to create the end to end solution in the CDK.
Right now we have constructs to cover all of the use case except a Lambda function accessing a Redshift database - that's what Hitendra was recommending.
Check out our Design Guidelines for what makes a good Solutions Construct.

Sure, I understand now. So, it would be a aws-lambda-redshift construct to accept RS Clusters parameters and S3 URL. I have already got the Lambda function which does the job. However, it needs to be modeled to follow the Solution Constructs standards.

Close - it would define a new Lambda function or accept an existing Lambda function, there would be no S3 aspect to it at all. Data would be read from S3 with an aws-s3-lambda pattern or perhaps an aws-lambda-s3 pattern, depending on what is triggering that activity.
This will be our first Amazon Redshift pattern - you will notice there is no discussion of common interface elements in DESIGN_GUIDELINES.md - so it will be defining how patterns interact with Amazon Redshift, which is a pretty big deal (how we interact with Lambda is pretty well defined at this point). As a first step, please write the README.md document that defines how the construct will work for us to review and collaborate on.

Also - we don't include any business logic in constructs, so the code for the Lambda function will not be included.

Sure, I will put together README doc and share it with you for review.


copy in mochiglobal and init config vars

This is not as clean as the partisan PR. I didn't feel comfortable messing with configure_defaults... I think this is a good starting place for a future refactoring. A number of the config values appear related solely to simulations, which I'd hope one day can be removed or moved to a better location?
The use of OS vars would be better done by the release. If that is something you are open to I'd be happy to make that patch as well. It basically removes all of the os:getenv because the start script relx provides will replace env vars in sys.config with their values at runtime, so application:gen_env will result in the value from the environment.

What do you propose as the fix for the os:getenv calls?

We'll gladly take the os:getenv fixes if you can provide a patch for those, and you think it cleans up the code and makes it more readable.

I realized we don't have a good way of doing defaults for unset os vars when using the sys.config method and replacing on release start. Each var would have to be set every time, so that isn't going to work. But makes me think I should look into improving relx to support that.


fix: error serialization in resumable-upload.ts

Existing error handling has wrong error serialization with .toString(), that leads to [object Object] error messages.  Example:
Error: Retry limit exceeded - [object Object]
at Upload.attemptDelayedRetry (/usr/src/app/node_modules/@google-cloud/storage/build/cjs/src/resumable-upload.js:818:26)
Better solution would be JSON.stringify the error
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

[ ] Make sure to open an issue as a bug/issue before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
[ ] Ensure the tests and linter pass
[ ] Code coverage does not decrease (if any source code was changed)
[ ] Appropriate docs were updated (if necessary)

the issue was discussed with Google Support via DoIT support team as a intermediate

Thank you for the contribution @eagleeye


tmpfs mounted over -v mounts: -v mount becomes empty

Issue:
If you run an image with tmpfs and a -v mount, docker first mounts -v, then tmpfs, making the -v mount disappear.
docker run -it --tmpfs /tmp:rw -v /tmp/.X11-unix:/tmp/.X11-unix alpine ls -a /tmp/
only shows . ..
while
docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix alpine ls -a /tmp/
shows .   ..   .X11-unix.
This makes it harder to use --read-only in production.
Proposed Fix:
mount tmpfs before -v.
Output of docker version:
docker version
Client:
 Version:      1.10.3
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   20f81dd
 Built:        Thu Mar 10 15:59:07 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.10.3
 API version:  1.22
 Go version:   go1.5.3
 Git commit:   20f81dd
 Built:        Thu Mar 10 15:59:07 2016
 OS/Arch:      linux/amd64

Same if /tmp is a volume

I couldn't confirm the bug two -v mounts. Could you provide a docker run example please? What version do you use?

/cc @rhatdan

Yes host bind mounts should always happen last.


switch to rococo staging with HW mode

as title
Note:

AES_GCM doesn't work with HW mode. SW mode is fine.
Replace AES_GCM to RING
adapt CI configs to use rococo parachain

resolved #144

Just notice it's still litmus runtime?

Yes. That's my last try with CI. Still working on rococo runtime.


Rule for detecting unneccessary braces aroung the trailing lambda

Expected Rule behaviour
The rule should flag that the trailing lambda can be used without the braces around it. Examples of compliant and non-compliant code
// non-compliant code
fun test() {
    repeat(10, {
       println(it)
    })
}

// compliant code
fun test() {
    repeat(10) {
        println(it)
    }
}

Additional information

Current version of ktlint: NA
Styleguide section: NA

Unfortunately that is not possible to do with a Ktlint rule. Ktlint has no knowledge about the signature of function repeat and as of that can not determine whether the lambda is the last parameter in the function.
Given function foo below:
    fun foo(bar: Boolean, block: () -> String) =
        if (bar) {
            block()
        } else {
            "no bar"
        }

then foo(true) { "Foo test" } is a valid call.
However, given function foo2 below:
    fun foo2(block: () -> String, bar: Boolean = true) =
        if (bar) {
            block()
        } else {
            "no bar"
        }

then foo2(true) { "Foo test" } or foo2 { "Foo test" } are not valid (compile error).
In order to check this, Ktlint should have more information about the call context which is out of scope for this project.

@paul-dingemans Thanks for the detailed explanation


AI Detection does not work with latest firmware.

So I have a problem with the latest firmware and decided to downgrade to see if it really was the firmware.
After downgrading the AI Detection works again.
My setup:
reolink_dev release: v0.19 (https://github.com/fwestenberg/reolink_dev/releases/tag/v0.19)
Home Assistant 2021.8.3
Camera: RLC-822A
Working firmware: V300177 https://reolink.com/download-center/
Non working firmware: V<IP_ADDRESS> https://reolink.com/download-center/
With working firmware V300177 I get the following result:
[ { "cmd" : "GetAiState", "code" : 0, "value" : { "channel" : 0, "people_state" : 0, "vehicle_state" : 0 } } ]

The "Person state" gets true once a person gets in front of the camera.
With the latest firmware V<IP_ADDRESS> I get the following result:
[ { "cmd" : "GetAiState", "code" : 0, "value" : { "channel" : 0, "face" : { "alarm_state" : 0, "support" : 0 }, "people" : { "alarm_state" : 0, "support" : 1 }, "vehicle" : { "alarm_state" : 0, "support" : 1 } } } ]

The "Person state" has now been renamed to "Person" and also "Face" has been added as attribute.
None of the attributes ever gets "True".
Can it be that the integration has to consider the new formatting from the API?
The firmware includes new attributes but also it specifies "alarm_state" and "support" for each attribute, this was not the case with previous versions.
I've seen multiple reports of people not having the "People" attribute ever change to "True" and all of the repports seems to have the same formatting.

Same issue here with rcl-510a and firmware <IP_ADDRESS>1

Same issue with RLC511WA and Firmware v<IP_ADDRESS> and v<IP_ADDRESS>4. Worked with the stock firmware, but after doing an update now its broken.

So Reolink Support just said that "People" alarm will be True only for 5 seconds (even if someone keeps moving on screen) so this HA integration needs to poll at least every 4 seconds to catch or it will just miss it.
"When an AI event is detected, if there is an active person in the screen (a person who is still or less active will not trigger the AI event), the mobile app will prompt someone, but the command used in the browser is his function It is designed to: only when an active person is detected, he will start the alarm, and only alarm for 5 seconds, after 5 seconds, even if there are still active people in the screen, it will not alarm again, when the active person disappears in the screen, the alarm The state will be reset and wait for the next AI event to be triggered.
"

An initial trigger will be enough for me to start record and do a screenshot. But in my case the whole person/vehicle detection does not work.
As i said, with the stock firmware it worked but since attribute change it stopped.

I fear this is because they also changed the behavior : the 5 seconds reset was not present earlier and I am not sure if this integration polls often enough. This integration will just pass the output of the variables, even if they were renamed, the new ones should still show accurately provided that the API call is done within said 5 seconds delay.

Personally, to make the AI detection work, I created 2 binary sensors which interrogate the GetAiState API to know the type of detection.
#binary_sensor.yaml
  #Car detection
  - platform: rest
    resource: !secret reolink_api_call
    name: is_car
    device_class: motion
    value_template: '{{ value_json[0].value.vehicle.alarm_state }}'
    scan_interval: 5
  #People detection
  - platform: rest
    resource: !secret reolink_api_call
    name: is_people
    device_class: motion
    value_template: '{{ value_json[0].value.people.alarm_state }}'
    scan_interval: 5

#secret.yaml
reolink_api_call: http://192.168.XX.XX/api.cgi?cmd=GetAiState&user=USER&password=PASSWORD

And in notification/automation I use these sensors

should be fixed in PR https://github.com/fwestenberg/reolink_dev/pull/274 . Waiting for author to issue a release.
@yagrasdemonde fantastic tip, thank you !

For me it's working now on RLC511WA v<IP_ADDRESS>4 and v0.20

Because of the lame implementation in Reolink API,you need to decrease
'scan_interval' to 4 seconds or less
On Tue, Sep 21, 2021, 20:54 CryPt00n @.***> wrote:

For me it's working now on RLC511WA v<IP_ADDRESS>4 and v0.20
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/fwestenberg/reolink_dev/issues/245#issuecomment-924289269,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABTC5PTLHSJDAV3P5HSQHX3UDDIFHANCNFSM5CIFDOHA
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

FYI a beta firmware just went up, which features a configurable time for detecting people and cars (and pets!) Not sure if that will impact this "edge like" triggering, however. Can't they just give us a nice PUSH service, were we give them a webhook to call on detection?

@reedstrm where did you find the new firmware? google or the reolink forums did not give me any results

Reolink's reddit
On Sat, Sep 25, 2021, 00:11 molnarti @.***> wrote:

@reedstrm https://github.com/reedstrm where did you find the new
firmware? google or the reolink forums did not give me any results
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/fwestenberg/reolink_dev/issues/245#issuecomment-926945706,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABTC5PUQZDQDNZBG7RUMTVTUDTZQJANCNFSM5CIFDOHA
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Personally, to make the AI detection work, I created 2 binary sensors which interrogate the GetAiState API to know the type of detection.
#binary_sensor.yaml
  #Car detection
  - platform: rest
    resource: !secret reolink_api_call
    name: is_car
    device_class: motion
    value_template: '{{ value_json[0].value.vehicle.alarm_state }}'
    scan_interval: 5
  #People detection
  - platform: rest
    resource: !secret reolink_api_call
    name: is_people
    device_class: motion
    value_template: '{{ value_json[0].value.people.alarm_state }}'
    scan_interval: 5

#secret.yaml
reolink_api_call: http://192.168.XX.XX/api.cgi?cmd=GetAiState&user=USER&password=PASSWORD

And in notification/automation I use these sensors

Just wanted to hop in and say thanks for this @yagrasdemonde. Spent hours trying to get the reolink intergration motion detection to work until I stumbled on this.
5 min and I got the RLC811a, 820a and E1 Zoom working (just changed to MD state for E1 and changed the value template a little).
Thank you so much!

@quadrupole1988
Now, with latest @fwestenberg release (with @cpainchaud  great contribution) we can get attributes people and vehicle directly from camera binary sensor.
Examples :
#binary_sensor.yaml
  - platform: template
    sensors:
      ###################### Vehicle from Reolink binary_sensor ######################
      is_vehicle:
        friendly_name: 'Is Vehicle'
        value_template: >-
          {{ state_attr('binary_sensor.cam_reolink_motion', 'vehicle') }}
        icon_template: 'mdi:car'
        unique_id: 'is_vehicle_id'
      ###################### People from Reolink binary_sensor ######################
      is_people:
        friendly_name: 'Is People'
        value_template: >-
          {{ state_attr('binary_sensor.cam_portail_motion', 'people') }}
        icon_template: 'mdi:account'
        unique_id: 'is_people_id'

@yagrasdemonde and don't forget to use "scan_interval: 3" in reolink_dev plugin paramaters to ensure you are not missing any of these

@fwestenberg  you may want to close this issue

sorry, but is this issue resolved? creating manual binary sensors on configuration.yaml and quering the reolink API is not something i consider a solution. motion detection should be handled in the plugin directly, but in v0.20 the face/person/vehicle attributes never change from false

@molnarti , they do change from FALSE, as a matter of fact I use them in my own automation and they work like a charm. Please remember Reolink's limitation so you have to change scan_interval to less than 5 seconds ("scan_interval: 3" ) in reolink_dev plugin settings

@molnarti also please make sure you are running reolink firmware version v<IP_ADDRESS>4

where do i set the scan_interval? in the plugin settings i don't see such an option and i cannot change anything there, as i get the message malformed error

it's a system setting, configured in configuration.yaml for example:
reolink_dev:
scan_interval: 3

Hi

Personally, to make the AI detection work, I created 2 binary sensors which interrogate the GetAiState API to know the type of detection.
#binary_sensor.yaml
  #Car detection
  - platform: rest
    resource: !secret reolink_api_call
    name: is_car
    device_class: motion
    value_template: '{{ value_json[0].value.vehicle.alarm_state }}'
    scan_interval: 5
  #People detection
  - platform: rest
    resource: !secret reolink_api_call
    name: is_people
    device_class: motion
    value_template: '{{ value_json[0].value.people.alarm_state }}'
    scan_interval: 5

#secret.yaml
reolink_api_call: http://192.168.XX.XX/api.cgi?cmd=GetAiState&user=USER&password=PASSWORD

And in notification/automation I use these sensors

Just wanted to hop in and say thanks for this @yagrasdemonde. Spent hours trying to get the reolink intergration motion detection to work until I stumbled on this.
5 min and I got the RLC811a, 820a and E1 Zoom working (just changed to MD state for E1 and changed the value template a little).
Thank you so much!

Hi everyone!
So firstly I add the code in binary_sensor.yaml and the code for user and password in secrets.yaml?
Then I add that line "reolink_dev:
scan_interval: 3" in configuration.yaml?
If i have more than one camera I just duplicate the code in secrets?
Im sorry but if its stupids questons but Imm new to this. :)

it's a system setting, configured in configuration.yaml for example:
reolink_dev:
  scan_interval: 3

what about adding this option to the integration config? does it have some technical limitations why it has to be configured over the configuration.yaml file?

Hi

Personally, to make the AI detection work, I created 2 binary sensors which interrogate the GetAiState API to know the type of detection.
#binary_sensor.yaml
  #Car detection
  - platform: rest
    resource: !secret reolink_api_call
    name: is_car
    device_class: motion
    value_template: '{{ value_json[0].value.vehicle.alarm_state }}'
    scan_interval: 5
  #People detection
  - platform: rest
    resource: !secret reolink_api_call
    name: is_people
    device_class: motion
    value_template: '{{ value_json[0].value.people.alarm_state }}'
    scan_interval: 5

#secret.yaml
reolink_api_call: http://192.168.XX.XX/api.cgi?cmd=GetAiState&user=USER&password=PASSWORD

And in notification/automation I use these sensors

Just wanted to hop in and say thanks for this @yagrasdemonde. Spent hours trying to get the reolink intergration motion detection to work until I stumbled on this.
5 min and I got the RLC811a, 820a and E1 Zoom working (just changed to MD state for E1 and changed the value template a little).
Thank you so much!

Hi everyone!
So firstly I add the code in binary_sensor.yaml and the code for user and password in secrets.yaml? Then I add that line "reolink_dev: scan_interval: 3" in configuration.yaml?
If i have more than one camera I just duplicate the code in secrets?
Im sorry but if its stupids questons but Imm new to this. :)
I can add that Im running that firmware that was suggested and installed the updated integration. Put in the code in the files but the state false doesnt change.

You forgot pets! I'm still using Zoneminder with Shell scripts...

from latest https://github.com/fwestenberg/reolink_dev/blob/master/TSHOOT.md
You can now customize option "Motion states update fallback delay (seconds)" directly from the UI


Gym registry issue prevents import of whynot

Hi,
I just started looking into that repo and went into troubles when trying to import the package in Python. I set up a new virtual environment with only whynot and dependencies installed (Python 3.8.14). Then, when running
import whynot as wn , I get the following error:

ImportError                               Traceback (most recent call last)
Cell In [2], line 4
1 import matplotlib.pyplot as plt
2 import numpy as np
----> 4 import whynot as wn
5 import whynot.gym as gym
7 import scripts.utils as utils
File ~/opt/miniconda3/envs/testenv/lib/python3.8/site-packages/whynot/init.py:5
3 version = "0.12.0"
4 from whynot.algorithms import *
----> 5 from whynot.simulators import *
6 from whynot import causal_graphs, dynamics, framework
7 from whynot.dynamics import (
8     DynamicsExperiment,
9     Run,
10 )
File ~/opt/miniconda3/envs/testenv/lib/python3.8/site-packages/whynot/simulators/init.py:4
1 """Simulator initialization."""
3 from whynot.simulators import civil_violence
----> 4 from whynot.simulators import credit
5 from whynot.simulators import delayed_impact
6 from whynot.simulators import dice
File ~/opt/miniconda3/envs/testenv/lib/python3.8/site-packages/whynot/simulators/credit/init.py:15
3 from whynot.simulators.credit.simulator import (
4     agent_model,
5     Config,
(...)
10     State,
11 )
13 from whynot.simulators.credit.dataloader import CreditData
---> 15 from whynot.simulators.credit.environments import *
17 SUPPORTS_CAUSAL_GRAPHS = True
File ~/opt/miniconda3/envs/testenv/lib/python3.8/site-packages/whynot/simulators/credit/environments.py:4
1 """Interactive environment for the credit simulator."""
2 import numpy as np
----> 4 from whynot.gym import spaces
5 from whynot.gym.envs import ODEEnvBuilder, register
6 from whynot.simulators.credit import (
7     agent_model,
8     CreditData,
(...)
13     State,
14 )
File ~/opt/miniconda3/envs/testenv/lib/python3.8/site-packages/whynot/gym/init.py:12
9 from gym.core import Env
10 from gym import logger
---> 12 from whynot.gym.envs import make, spec, register
14 all = ["Env", "make", "spec", "register"]
File ~/opt/miniconda3/envs/testenv/lib/python3.8/site-packages/whynot/gym/envs/init.py:3
1 """Environments based on WhyNot simulators."""
----> 3 from whynot.gym.envs.registration import registry, register, make, spec
4 from whynot.gym.envs.ode_env import ODEEnvBuilder
File ~/opt/miniconda3/envs/testenv/lib/python3.8/site-packages/whynot/gym/envs/registration.py:4
1 """Global registry of environments, for consistency with openai gym."""
2 import importlib
----> 4 from gym.envs.registration import EnvRegistry
6 # Keep for consistency with original API
7 # pylint:disable-msg=invalid-name
8 # Have a global registry
9 registry = EnvRegistry()
ImportError: cannot import name 'EnvRegistry' from 'gym.envs.registration' (/Users/.../opt/miniconda3/envs/testenv/lib/python3.8/site-packages/gym/envs/registration.py)

Because this seems to be related to gym (by default version 0.26.2 got installed), I tried out different gym versions and indeed with gym version 0.23.0 or lower the import works. So maybe, a quick-fix could be to restrict the gym version. It seems that from version 0.24.0 onwards, the gym registry module/API got changed causing an issue when importing whynot.
Having gym 0.23.0 installed, allows me to run the performative prediction example, which is what I'm currently interested in. However, in the walkthrough example there still occurs an error when running the simulator of world3:
dataset = experiment.run(num_samples=200, seed=1234, show_progress=True)

RuntimeError: Native library not available at /Users/mgorecki/opt/miniconda3/envs/testenv/lib/python3.8/site-packages/py_mini_racer/libmini_racer.dylib

I couldn't resolve that so far.

Hello,
I also had this issue while importing whynot and got the same import error for EnvRegistry in Gym. Thanks to what @milagorecki suggested, installing the gym version 0.23.0 fixed the issue for me, however, it would be nice if you could make changes in the code accordingly to resolve this issue so others won't get stuck.
Thanks!

As @milagorecki said, to fix this issue adequately, we'd have to make whynot consistent with the current gym versions that have changed. We'd love to have help with that and I'd greatly appreciate any contributions from the community.

The PR fixes this issue in the sense that's now using gym 0.23 by default.
However, instead of working on further versions of gym, my preferred course of action would be working on compatibility for gymnasium. gym was discontinued by OpenAI and gymanasium (its continuation) was picked up by Farama.

Thanks for your contribution!


Support for Serialization of Knock::AuthToken

How do you feel about supporting serialization of Auth tokens?
I typically create api's that use the jsonapi.org spec (using active_model_serializers) and would like the entire app to use the spec. The default jwt response doesn't fit the spec:
{"jwt":"eyJ0eXAiOiTRSGciOiJIUzI1NiJ9.eyJleIOVU0OTEwNTQ4NTR9.mf4zC-MugaLVQr-Fq9ZdnHG9yYU6QWjIUVUzjjoh3Y"}

The response payload that I think I would like is something like this:
{
    "data": {
        "id": "eyJ0eXAiOiTRSGciOiJIUzI1NiJ9.eyJleIOVU0OTEwNTQ4NTR9.mf4zC-MugaLVQr-Fq9ZdnHG9yYU6QWjIUVUzjjoh3Y",
        "type": "knock_auth_tokens",
        "attributes": {
            "expiration":<PHONE_NUMBER>
        }
    }
}

The id being the token is strange, I know, but the jsonapi spec requires an ID field.
When I tried to use a custom serializer, I had 2 issues, first:
First Issue

undefined method `read_attribute_for_serialization' for #Knock::AuthToken:0x000000069da6d8

The fix for that is either include ActiveModel::Serialization:
class Knock::AuthToken
  include ActiveModel::Serialization
end

OR add a #read_attribute_for_serialization method, something like this:
class Knock::AuthToken
  def read_attribute_for_serialization(key)
    self.send(key) if self.respond_to?(key)
  end
end

Second Issue (If including ActiveModel::Serialization)

undefined method `id' for #Knock::AuthToken:0x000000057279c8

A fix for that can either be done on the AuthToken object:
class Knock::AuthToken
  include ActiveModel::Serialization

  def id
    self.token
  end
end

OR on the serializer:
class Knock::AuthTokenSerializer < ActiveModel::Serializer
  def id
    object.token
  end
end

The solutions above don't really feel right, since they are tied to active model serializations... but support for serialization (or documentation for how to go about serialization) would be great.
I would be happy to contribute if you had some opinions on the solution.

If I am not mistaken, the format that you are trying to achieve is actually for resource objects. JSON API doesn't really say much about how token related responses should be returned.
However, I think you can modify the Knock response by customizing the Knock::AuthTokenController's create method.

I believe include ActiveModel::Serialization is missing in the AuthToken model?
Still, I managed to get it to work with this:
class AuthTokenSerializer < ActiveModel::Serializer

  attributes :jwt, :payload

  def jwt
    object.token
  end

  def payload
    object.payload
  end
end


Align prev record CRC on 8-bytes boundary

I don't understand why this is needed. last_record_lsn should always point to the beginning of a record, there should never be a need to align it AFAICS.

I don't understand why this is needed. last_record_lsn should always point to the beginning of a record, there should never be a need to align it AFAICS.

My assumptions were the same, this is why I was very surprised when see in the log errors that xl_prev contains inva;id value. I was even more surprised when see that it is not aligned on 8.
If you look at WalStreamDecoder.poll_decode, then you will out that it returns notLSN of record start, but LSN of record end. It was even written in comment, So it is not a bug, but intended behavior. The comment says:
    /// Returns one of the following:
    ///     Ok((Lsn, Bytes)): a tuple containing the LSN of next record, and the record itself

actually it is not quite true: LSN of next record is aligned on 8 and it actually returns LSN of end of record. And this value is used in advance_last_record_lsn. May be it is better to align returned value on 8 rather than align xl_prev.


create edabit issues

Before submitting a PR please Check some details.Check Edabit for problem task

[ ]  Check for the problem and make sure it's doesn't exist in solution already
[ ] fileName formet should be in camelcase
example- returnTheNextNumber.py
[ ]  Add label for Problem
[ ]  In file there should be problem statement and link to probelm
example -

'''
    Probem Task : This program will add two numbers
    Problem Link : https://edabit.com/challenge/SFzHtm63XT6EYNHWY
'''
*/
def main():
    return a + b

This repository is vaild for HacktoberFest2020
Read before making PR - How to contribute on Github
Good Luck,

Can i work on this ?

@rexdivakar  Yes sure , This issue is open for all.
Task - Create issue from Edabit problem, make sure to avoid duplicate question. use template for making issue.
Best of Luck

@rexdivakar  Yes sure , This issue is open for all.
Task - Create issue from Edabit problem, make sure to avoid duplicate question. use template for making issue.
Best of Luck

Is it fine can I raise the PR after Oct 1st so my PR gets considered for the Hacktoberfest

Make your PR after 1 October for HacktoberFest

How can I make a PR for primorial problem?


llvmPackages.clang unable to find headers of compiler-rt

Describe the bug
Given a simple program:
#include <sanitizer/common_interface_defs.h>

int main (int argc, char *argv[]) { return 0; }

$ clang main.c

produces
main.c:1:10: fatal error: 'sanitizer/common_interface_defs.h' file not found
#include <sanitizer/common_interface_defs.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Expected behavior
The code should also compile with llvmPackages.clang, clang should be able to find headers of compiler-rt.
Additional context
The same code compiles with gcc and rocmPackages.llvm.clang. It seems that rocmPackages is built very differently compared to llvmPackages.
The interested headers are provided by llvmPackages.compiler-rt.dev. I tried to look at nixpkgs/pkgs/development/compilers/llvm/15/compiler-rt, but can't understand how the dev output works. I don't see the use of $dev at all.
Notify maintainers

llvmPackages maintainers @dtzWill @Ericson2314 @lovek323 @primeos @RaitoBezarius @rrbutani @sternenseemann
rocmPackages maintainers @acowley @lovesegfault @Madouura @Flakebi
Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
$ nix run nixpkgs#nix-info  -- -m
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.63, NixOS, 24.05 (Uakari), 24.05.20231127.8cfef69`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - nixpkgs: `not found`

Add a :+1: reaction to issues you find important.

Does tests.cc-wrapper.llvmTests.llvmPackages.clang build for your nixpkgs revision? If not, please report the used  revision for the test, e.g. in form of lib.version.
My inclination is that you have to pass the appropriate -fsanitize=… flag to clang for it to make the headers available as is done in the test mentioned above.

tests.cc-wrapper.llvmTests.llvmPackages.clang builds for my nixpkgs version. In fact, nix build nixpkgs#tests.cc-wrapper.llvmTests.llvmPackages.clang works fine.
Also, running nix develop nixpkgs#tests.cc-wrapper.llvmTests.llvmPackages.clang and inside the shell I can compile sanitizers.c (as well as the simple program in my bug report) without the -fsanitize=... flags. clang sanitizers.c works fine.
OTOH the clang that I obtain using nix shell nixpkgs#llvmPackages.clang can't compile sanitizers.c.

This may be a case of using a wrapped clang vs using an unwrapped clang. But not completely sure what the right way is then to get a wrapped version.


Unable to run teslamate in IPv6-only environment

Describe the bug
I am trying to run teslamate in an IPv6-only environment, however, when connecting to the (remote) database, I get the following error:
/usr/src/teslamate/_build/prod/rel/teslamate/bin/teslamate eval "TeslaMate.Release.migrate"
21:11:05.430 [error] Postgrex.Protocol (#PID<0.238.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (db.example.org:5432): non-existing domain - :nxdomain

This is from a manual install, and with DATABASE_HOST=db.example.org set in the environment.
Expected behavior
I would expect the connection to succeed. I have verified that the connection works with the regular 'psql' database client.
How to reproduce it (as minimally and precisely as possible):

Install teslamate on an IPv6-only host
Try to connect to database

Relevant entries from the logs
As above:
/usr/src/teslamate/_build/prod/rel/teslamate/bin/teslamate eval "TeslaMate.Release.migrate"
21:11:05.430 [error] Postgrex.Protocol (#PID<0.238.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (db.example.org:5432): non-existing domain - :nxdomain

Environment

TeslaMate version: v1.20.0
Type of installation: Manual
OS TeslaMate is installed on: Debian Buster
User OS & Browser: N/A

@tohojo Can you try this PR and see if that fixes your issue: #1006? With DATABASE_IPV6=true IPv6 should be used to connect to Postgres.

Ah, no, Grafana works and can connect to the database, and I can import the dashboards. But obviously there's no data in them, and the teslafi login page itself (where I input my Tesla credentials) just gives me that "Error: unknown".
I also got this in the logs now:
[warn] Update check failed: %Mint.TransportError{reason: :enetunreach}

So I guess it has the same issue connecting to the Tesla API? And maybe it'll also have trouble with MQTT once it gets that far?

Gotcha! Yeah, the update check fails because GitHub does not support IPv6. And the Tesla Onwer API also does not seem to support it.

Ah, but they do! :)
The host is behind a DNS64/NAT64 gateway. E.g.,:
$  curl -v https://api.github.com/
*   Trying 2a00:cens:ored:6464::8c52:7905...
* TCP_NODELAY set
* Expire in 149974 ms for 3 (transfer 0x55852aff2920)
* Expire in 200 ms for 4 (transfer 0x55852aff2920)
* Connected to api.github.com ( 2a00:cens:ored:6464::8c52:7905) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=*.github.com
*  start date: Jun 22 00:00:00 2020 GMT
*  expire date: Aug 17 12:00:00 2022 GMT
*  subjectAltName: host "api.github.com" matched cert's "*.github.com"
*  issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 High Assurance Server CA
*  SSL certificate verify ok.
> GET / HTTP/1.1
> Host: api.github.com
> User-Agent: curl/7.64.0
> Accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/1.1 200 OK
< date: Tue, 13 Oct 2020 16:36:13 GMT
< server: GitHub.com
< status: 304 Not Modified
< cache-control: public, max-age=60, s-maxage=60
< vary: Accept, Accept-Encoding, Accept, X-Requested-With, Accept-Encoding
< access-control-expose-headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
< access-control-allow-origin: *
< strict-transport-security: max-age=31536000; includeSubdomains; preload
< x-frame-options: deny
< x-content-type-options: nosniff
< x-xss-protection: 1; mode=block
< referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
< content-security-policy: default-src 'none'
< content-type: application/json; charset=utf-8
< x-github-media-type: github.v3; format=json
< ETag: W/"27278c3efffccc4a7be1bf315653b901b14f2989b2c2600d7cc2e90a97ffbf60"
< X-Ratelimit-Limit: 60
< X-Ratelimit-Remaining: 58
< X-Ratelimit-Reset:<PHONE_NUMBER>
< X-Ratelimit-Used: 2
< Accept-Ranges: bytes
< Content-Length: 2308
< X-GitHub-Request-Id: D650:624B:E3D0189:10B59D84:5F85D786
<
{
  "current_user_url": "https://api.github.com/user",
  "current_user_authorizations_html_url": "https://github.com/settings/connections/applications{/client_id}",
  "authorizations_url": "https://api.github.com/authorizations",
  "code_search_url": "https://api.github.com/search/code?q={query}{&page,per_page,sort,order}",
  "commit_search_url": "https://api.github.com/search/commits?q={query}{&page,per_page,sort,order}",
  "emails_url": "https://api.github.com/user/emails",
  "emojis_url": "https://api.github.com/emojis",
  "events_url": "https://api.github.com/events",
  "feeds_url": "https://api.github.com/feeds",
  "followers_url": "https://api.github.com/user/followers",
  "following_url": "https://api.github.com/user/following{/target}",
  "gists_url": "https://api.github.com/gists{/gist_id}",
  "hub_url": "https://api.github.com/hub",
  "issue_search_url": "https://api.github.com/search/issues?q={query}{&page,per_page,sort,order}",
  "issues_url": "https://api.github.com/issues",
  "keys_url": "https://api.github.com/user/keys",
  "label_search_url": "https://api.github.com/search/labels?q={query}&repository_id={repository_id}{&page,per_page}",
  "notifications_url": "https://api.github.com/notifications",
  "organization_url": "https://api.github.com/orgs/{org}",
  "organization_repositories_url": "https://api.github.com/orgs/{org}/repos{?type,page,per_page,sort}",
  "organization_teams_url": "https://api.github.com/orgs/{org}/teams",
  "public_gists_url": "https://api.github.com/gists/public",
  "rate_limit_url": "https://api.github.com/rate_limit",
  "repository_url": "https://api.github.com/repos/{owner}/{repo}",
  "repository_search_url": "https://api.github.com/search/repositories?q={query}{&page,per_page,sort,order}",
  "current_user_repositories_url": "https://api.github.com/user/repos{?type,page,per_page,sort}",
  "starred_url": "https://api.github.com/user/starred{/owner}{/repo}",
  "starred_gists_url": "https://api.github.com/gists/starred",
  "user_url": "https://api.github.com/users/{user}",
  "user_organizations_url": "https://api.github.com/user/orgs",
  "user_repositories_url": "https://api.github.com/users/{user}/repos{?type,page,per_page,sort}",
  "user_search_url": "https://api.github.com/search/users?q={query}{&page,per_page,sort,order}"
}
* Connection #0 to host api.github.com left intact

So really this seems to be the same issue as with the database without the fix...

Any success with the latest commit on #1006?

Yes, much better, thanks! I can connect and get data from the car now; only thing that's not working as far as I can tell is MQTT publishing (MQTT_HOST is also set to an IPv6-only hostname).

Managed to work around the MQTT issue by proxying it, but it would be good to have that just work over IPv6 as well. I'm also getting these in the logs:
Oct 13 20:06:17 teslamate teslamate[33668]: 22:06:17.646 [warn] Elevation query failed: %SRTM.Error{message: "HTTP request failed", reason: %Mint.TransportError{reason: :enetunreach}}
Oct 13 20:06:17 teslamate teslamate[33668]: 22:06:17.713 [warn] Elevation query failed: %SRTM.Error{message: "HTTP request failed", reason: %Mint.TransportError{reason: :enetunreach}}
Oct 13 20:06:17 teslamate teslamate[33668]: 22:06:17.730 [warn] Elevation query failed: %SRTM.Error{message: "HTTP request failed", reason: %Mint.TransportError{reason: :enetunreach}}

though I'm not sure if it actually fails permanently, or if it's just a transient error - there are just a lot of:
Oct 13 20:06:28 teslamate teslamate[33668]: 22:06:28.892 [info] Adding elevation to 1000 positions ...

afterwards.

Also, not sure if this is related, or if it's normal, but I'm seeing a lot of connection messages in the log:
Oct 13 22:02:51 teslamate teslamate[33668]: 00:02:51.976 [info] Starting logger for 'My Car Name'
Oct 13 22:02:54 teslamate teslamate[33668]: 00:02:54.721 car_id=1 [info] Start / :online
Oct 13 22:02:54 teslamate teslamate[33668]: 00:02:54.728 car_id=1 [info] Connecting ...
Oct 13 22:02:55 teslamate teslamate[33668]: 00:02:55.646 car_id=1 [info] Start / :online
Oct 13 22:02:55 teslamate teslamate[33668]: 00:02:55.653 car_id=1 [info] Connecting ...
Oct 13 22:02:57 teslamate teslamate[33668]: 00:02:57.621 car_id=1 [info] Start / :online
Oct 13 22:02:57 teslamate teslamate[33668]: 00:02:57.628 car_id=1 [info] Connecting ...
Oct 13 22:03:00 teslamate teslamate[33668]: 00:03:00.668 car_id=1 [info] Start / :online
Oct 13 22:03:00 teslamate teslamate[33668]: 00:03:00.681 car_id=1 [info] Connecting ...
Oct 13 22:03:03 teslamate teslamate[33668]: 00:03:03.949 car_id=1 [info] Start / :online
Oct 13 22:03:03 teslamate teslamate[33668]: 00:03:03.956 car_id=1 [info] Connecting ...
Oct 13 22:03:04 teslamate teslamate[33668]: 00:03:04.584 car_id=1 [info] Start / :online
Oct 13 22:03:04 teslamate teslamate[33668]: 00:03:04.590 car_id=1 [info] Connecting ...
Oct 13 22:03:05 teslamate teslamate[33668]: 00:03:05.325 [info] Starting logger for 'My Car Name'
Oct 13 22:03:06 teslamate teslamate[33668]: 00:03:06.072 car_id=1 [info] Start / :online
Oct 13 22:03:06 teslamate teslamate[33668]: 00:03:06.078 car_id=1 [info] Connecting ...
Oct 13 22:03:07 teslamate teslamate[33668]: 00:03:07.090 car_id=1 [info] Start / :online
Oct 13 22:03:07 teslamate teslamate[33668]: 00:03:07.097 car_id=1 [info] Connecting ...
Oct 13 22:03:07 teslamate teslamate[33668]: 00:03:07.724 car_id=1 [info] Start / :online
Oct 13 22:03:07 teslamate teslamate[33668]: 00:03:07.734 car_id=1 [info] Connecting ...
Oct 13 22:03:10 teslamate teslamate[33668]: 00:03:10.595 car_id=1 [info] Start / :online
Oct 13 22:03:10 teslamate teslamate[33668]: 00:03:10.602 car_id=1 [info] Connecting ...
Oct 13 22:03:11 teslamate teslamate[33668]: 00:03:11.203 car_id=1 [info] Start / :online
Oct 13 22:03:11 teslamate teslamate[33668]: 00:03:11.210 car_id=1 [info] Connecting ...
Oct 13 22:03:14 teslamate teslamate[33668]: 00:03:14.690 car_id=1 [info] Start / :online
Oct 13 22:03:14 teslamate teslamate[33668]: 00:03:14.696 car_id=1 [info] Connecting ...

Those are the attempts to connect to the WebSocket based streaming API. The library used seems to set up the socket for IPv4 by default and does not support passing socket options. The same applies to the library used to get elevation data. I suspect we will not get much further without modifying these libraries.

Right, fair enough. The IPv6 support for the database connection is the most important thing to me (and MQTT if that is straight-forward to fix as well). I can arrange for v4 connectivity to the internet for the API connectivity... Indeed doing so fixes the constant reconnections :)

IPv6 support for the MQTT connection should theoretically be straightforward, as the client library allows the passing of the required options. However, there is a bug in the passing of this specific option which would need to be fixed by the author of the library first. I will create a issue in his repo when I have time.

Awesome! I'll keep the proxy in the meantime - thanks :)

Can you try the master branch now? If MQTT_IPV6 is set to true it should connect to your MQTT broker via IPv6.

Adrian Kumpf<EMAIL_ADDRESS>writes:

Can you try the master branch now? If MQTT_IPV6 is set to true it
should connect to your MQTT broker via IPv6.

Tried master and couldn't get it to compile:
# mix deps.get --only prod
** (CompileError) config/config.exs:23: undefined function config_env/0
    (stdlib 3.13.2) lists.erl:1358: :lists.mapfoldl/3
    (elixir 1.10.4) expanding macro: Kernel.to_string/1
    config/config.exs:23: (file)
    (elixir 1.10.4) expanding macro: Config.import_config/1
    config/config.exs:23: (file)

Yep, master requires Elixir v1.11.

Adrian Kumpf<EMAIL_ADDRESS>writes:

Yep, master requires Elixir v1.11.

Ah, right, gotcha! After upgrading Elixir I am now running the master
branch with native MQTT and database connections - thanks a bunch! :)


feat/Decouple Partitioning User API and Implementation

Description
The user API is tightly bound to the internal implementation of the partitioners. As a result, changes in keyword arguments or function behavior immediately impact the user API. Users have direct access to the implementation functions, as indicated in the current documentation. This tight coupling restricts our flexibility to refactor or enhance the partitioners without introducing breaking changes.
The proposed changes are intended to increase the speed of development and eventually provide the ability to introduce new user facing APIs in the future.
Proposed Solution
Introduce an abstraction layer between the user API and the partitioner implementations. This layer would expose only the necessary functionalities and delegate to the appropriate partitioners. This decoupling allows for more flexibility in internal changes without affecting the user API. A phased approach would be needed, where this issue would be the first step of the following:

Move the contents of the partition function for each partitioner into a private function _partition_{type}. For example, the email partitioner. While this seems trivial, it will enable us to further develop the partitioners without obstructing APIs that users may have in production. It will enable us to simplify and consolidate functionality in the partitioners so that we can eventually support a simpler interface for users in the future.

@process_metadata()
@add_metadata_with_filetype(FileType.EML)
@add_chunking_strategy()
def partition_email(
    filename: Optional[str] = None,
    file: Optional[Union[IO[bytes], SpooledTemporaryFile]] = None,
    text: Optional[str] = None,
    content_source: str = "text/html",
    encoding: Optional[str] = None,
    include_headers: bool = False,
    max_partition: Optional[int] = 1500,
    include_metadata: bool = True,
    metadata_filename: Optional[str] = None,
    metadata_last_modified: Optional[str] = None,
    process_attachments: bool = False,
    attachment_partitioner: Optional[Callable] = None,
    min_partition: Optional[int] = 0,
    chunking_strategy: Optional[str] = None,
    **kwargs,
) -> List[Element]:
    """ Wrap the _partition_email function to separate user facing API from internal API"""
    return _partition_email(
        filename=filename,
        file=file,
        text=text,
        content_source=content_source,
        encoding=encoding,
        include_headers=include_headers,
        max_partition=max_partition,
        include_metadata=include_metadata,
        metadata_filename=metadata_filename,
        metadata_last_modified=metadata_last_modified,
        process_attachments=process_attachments,
        attachment_partitioner=attachment_partitioner,
        min_partition=min_partition,
        chunking_strategy=chunking_strategy,
        **kwargs,
    )

Follow-up phases/issues after completing phase 1:
2. Extract file reading into it's own function that passes a stream to the private partition functions
3. Move metadata processing from a decorator to a function call before/after partitioning. This allows us to support preprocessing steps for handling user input (e.g. language) and post-processing steps for consolidating processed element data (e.g. hierarchy, chunking) in a decoupled interface that can be better unit tested.
4. Move chunking from a decorator to a function call after partitioning
5. Write a new user facing api for accessing the simpler, decoupled components
All of this can be done incrementally, per partitioner. The end goal is to reduce the complexity of the keyword arguments in the user-facing API and reduce the coupling of downstream components for further feature development. In particular for document pre/post processing: metadata such as language and hierarchy, chunking, and document level metadata such as encoding, content source.
Alternatives
Do Nothing: Leave it as it is and continue with the tightly coupled system, accepting the maintenance and extensibility costs.
Additional Context
Unstructured already has an abstraction layer to some degree with the auto partitioner, the documentation does advocate though for using document-specific partitioners for increased speed, fewer dependencies and additional features.

A couple very nice concrete benefits of this that I see:

Ease unit-testing. Decorators complicate unit testing because the "inner" function cannot be isolated from the decorator function. So the only alternative is to test the entire "glued-together" composition. Having a facade API function allows the core partitioner to be tested in isolation from the decorated API function.
Allow flexible composition of implementation from distinct units. An API function naturally tends to become "fat" with keyword options as functionality is added. This is good for the user (if designed carefully) providing them a lot of flexibility. However, not all options are necessarily used by all parts of the implemention. We can see this already where some kwargs are used by decorators only. A distinct API function allows the implementation to be flexibly composed and recomposed from a growing set of distinct "step" or "aspect" implementor functions, each taking only the arguments they require. This improves our ability to respond to newly added function without struggling with a rigid implementation.

I think others are going to occur to me, but that's a start :)

Related: #1520

Related PR #1527


Python 3 support

Originally submitted to Google Code by sabbir.shafi on 18 Aug 2013

Later versions of Python 2.7 does not support robot framework...

Word on the street (https://github.com/robotframework/robotframework/issues/1912#issuecomment-73610630) is that RF 2.9 will drop j/python 2.5 support.  Does that mean that the python3 support can be / will be integrated in RF 2.9?

I doubt we have time for that. The main goal of dropping 2.5 support is making it easier to add 3.x support later. If required changes are not too big, we can consider that already in RF 2.9, though.

Status update :)
The latest release of my Python 3 compatibility port is 2.8.7:
https://github.com/userzimmermann/robotframework/releases/tag/python3-2.8.7
https://pypi.python.org/pypi/robotframework-python3/2.8.7
Complete diff to original 2.7.8:
https://github.com/userzimmermann/robotframework/compare/2.8.7...python3-2.8.7
Further I merged with recent commit https://github.com/robotframework/robotframework/commit/3a7571d23030166244c8dd1785346b41680dadbf which already contains many Python 2.5 incompatible code updates as discussed in #1928 and lots of code restructuring.
I got a lot of merge conflicts :D but they are solved.
There are only a few new utests and atests which need some more compatibility adaptions.
You can always get the latest complete code diff at:
https://github.com/userzimmermann/robotframework/compare/master...python3
I also started to create issues for atests FAILing on Python 3:
https://github.com/userzimmermann/robotframework/issues
So anyone can participate in solving them. They generally only need workarounds in the atests themselves.
And the best thing is... actually not the best but very close ;)
It is still running on Python 2.6!!! (At least with Python 2.6.8)
I remember there were some issues with Python 2.6 in the beginning of my fork. I can't remember exactly. But I declared my fork incompatible with Python 2.6 because of them and defined 2.7 as the only compatible Python 2 version. I was just curious and ran the tests of the current code with Python 2.6 and it worked. Maybe the earlier issues were only related to older Python 2.6.x versions or somehow resolved by using six.
I would appreciate if someone could run the tests with some older Python 2.6 version.

Great progress! I browsed through parts of the diff and here are some comments:

Wow, lot of changes! Luckily changes under src seem to be mostly pretty simple.

There are a lot of changes related to print and 1 / 2 that could be easily merged to master. We can either add from __future__ import print_function, division to relevant files or just use print('hi') and 1 // 2 formats without them. The former is probably better under src, but the latter ought to be adequate in tests. Additionally, using print for logging could be replaced with robot.api.logger in many places to avoid print altogether.

In general I hope we could get started with this work by getting more and more Python 3 compatibility in as smallish pull requests. Massing PR with all changes is just way too much to review. Smallish PRs fixing individual topics, like print or division, would be much easier to handle for everyone involved.

We need to think what to do with six. I would not like to make it a required dependency for people wanting to run Robot on Python 2 (nor on Python 3 if possible). Currently Robot has no external dependencies, and it definitely eases installing it on environments without network access. We'll see later do we actually need it or could we live without. It's anyway best to start from easier changes that don't require it.

I browsed through the diff a little longer and I'm fairly convinced we don't eventually need six. Things to do instead:

Add utility functions is_string, is_unicode, is_integer to avoid isinstance checks against basestring, unicode and (int, long) that have all changed. Natural home for these is utils.robottypes. Current is_str_like should be renamed to is_string_like to be consistent with is_string (I don't want is_str because it would be misleading). All this could be done in master right away!

Add PYTHON3 and PYTHON2 flags to utils next to newly added JYTHON, WINDOWS, etc. I prefer that spelling instead of PY2/3 because it is consistent with our other flags.

I basically agree that most of my six use can be handled with some simple custom compatibility layer.
I also used only a small fraction of all the six features.
However, there are some features like six.moves, with_metaclass and reraise which need some more effort to reimplement and which end up in reinventing the wheel to some degree.
Anyway, I started adding PYTHON2/3 vars and is_<type>/<type>_like functions and some common type definitions and imports to robot.utils and opened  pull request #1937 for this.

I know there are cases where six would really help us, but I'm not yet convinced we need it so much that having an additional dependency is worth it. Handling differences between str/unicode/int/long types ought to be easy as PR #1937 indicates. Do you have an idea how many places we have where six.moves, with_metaclass or reraise are needed? If there are only few, special casing them shouldn't be a big problem.

It took a while... I was quite busy the last weeks... but: 2.9a1 !
https://github.com/userzimmermann/robotframework/releases/tag/python3-2.9a1
https://pypi.python.org/pypi/robotframework-python3/2.9a1
Complete diff to original 2.9a1:
https://github.com/userzimmermann/robotframework/compare/2.9a1...python3-2.9a1
Now I will continue with #1937

It's been a while... again ;)
I merged with 2.9rc1 and things are still working very well!
Lots of merging conflicts due to #1990 but nice to see how the diff is slowly shrinking... ;)
https://github.com/userzimmermann/robotframework/compare/master...python3
I will do some some further cleanup and resolve an additional atest issue and then make a robotframework-python3-2.9rc1 release... trying to get it done this evening

No need for a robotframework-python-2.9rc1 release:
https://pypi.python.org/pypi/robotframework-python3/2.9
https://github.com/userzimmermann/robotframework/releases/tag/python3-2.9
Right on time! :)

@pekkaklarck After applying is_<type> checks from #1990 to the test code, I would like to introduce __future__.print_function to the standard code base as next migration step. What do you think?

print_function sounds fine. In many places it would be a good idea to avoid print in favor of robot.api.logger or sys.stdout.write, depending on the context.

Official Python 3 support is very close. All acceptance tests pass on Linux, OSX and Windows, and installation with Python 3 seems to work fine. Final tasks to do before this issue can be considered done:

[ ] setup.py must be updated to list Python 3 as a supported version.
[ ] Go through TODOs and FIXMEs in code and see is there anything Python 3 related.
[ ] Document supported Python versions (2.6, 2.7, 3.3->) in User Guide, README.rst, and INSTALL.rst.
[ ] Decide do we want to create pybot3 script to avoid overwriting pybot script created by Python 2. Alternatively we could start using generic robot script with all interpreters. That requires a separate issue, though.

Final tasks listed in my previous comment are all either done or handed by other issues. I guess we can consider this issued finally done! Go Python 3!!!!!!!!!!!!!!!!!!


boards.txt on mac is on a very nasty path

It is on /Users/{user}/Library/Arduino15/packages/arduino/hardware/avr/{version}/boards.txt
Maybe it is worth updating the wiki

Yeah. The boards.txt thing is really not necessary as you can just select the ESP32 DevKit V1. So there is no use for it.

Yeah. The boards.txt thing is really not necessary as you can just select the ESP32 DevKit V1. So there is no use for it.

OH really? I missed that part on the docs

baords.txt is removed from the repo.