[Question] Why does event listener need 'static lifetime

I'm starting out with some of the examples and am exploring ways to manage mutable state. One restriction I have run into is the 'static requirement for the event listener closure. This is from the IEventTarget trait:
    fn add_event_listener< T, F >( &self, listener: F ) -> EventListenerHandle
        where T: ConcreteEvent, F: FnMut( T ) + 'static

In the examples, a Rc<RefCell<_>> is passed to the closure so we can safely mutate the state. It is a convenient tool for getting around the borrow checker. Both Rc and RefCell add to runtime overhead which makes me a little uncomfortable, so I started looking for a different solution. The best one I have so far is using a static mut state and wrapping all usage inside an unsafe block. This feels wrong to me.
Why is the trait written this way, and what other options do I have for mutating my state in the event listener closure?

The reason is because JavaScript can call the closure at any time (including asynchronously).
Imagine that you have some stack variable which the closure is using:
let mut x = "foobar";

foo.add_event_listener(|e: MouseClickEvent| {
    x = "quxcorge";
});

There's two problems here:

The closure is called asynchronously, so when the event has happened, the stack frame is already gone, which means the variable x no longer exists: that's a use-after-free bug!

Even if the closure was called synchronously, JavaScript might take that closure, store it away somewhere, and then call it later (after the stack frame is gone). Again, a use-after-free bug!

In order to fix this, you can simply move the variable into the closure:
let mut x = "foobar";

foo.add_event_listener(move |e: MouseClickEvent| {
    x = "quxcorge";
});

Since the closure now owns the variable x, the variable x is no longer tied to the stack, so everything works out perfectly. In addition, this has absolutely no performance cost.
However, the downside of the above approach is that you can only access the variable within a single closure. If you have some state that you want to share with many closures, then you must use Rc + RefCell / Cell (or Arc + Mutex / RwLock / AtomicUsize / etc.):
let x = Rc::new(RefCell::new("foobar"));

{
    let x = x.clone();

    foo.add_event_listener(move |e: MouseClickEvent| {
        let x = x.borrow_mut();
        *x = "quxcorge";
    });
}

{
    let x = x.clone();

    foo.add_event_listener(move |e: MouseClickEvent| {
        let x = x.borrow_mut();
        *x = "quxcorge";
    });
}

This works because Rc moves the value into the heap, so it's no longer on the stack, so now it can be safely used inside of the closure. The RefCell is needed because Rc doesn't allow for mutation, so you need to use RefCell / Cell / etc. to add mutation.
As another alternative, you can use lazy_static! instead:
lazy_static! {
    static ref X: Mutex<&'static str> = Mutex::new("foobar");
}

foo.add_event_listener(|e: MouseClickEvent| {
    let x = X.lock().unwrap();
    *x = "quxcorge";
});

foo.add_event_listener(|e: MouseClickEvent| {
    let x = X.lock().unwrap();
    *x = "quxcorge";
});

This still has a performance cost (from the Mutex), and it also means that the state will live forever, it will never be dropped. In addition, lazy_static requires the data type to implement Sync, and not all data types implement Sync! Sometimes this is what you want, but I personally recommend Rc instead.
Technically you could use a mutable static (and unsafe) to avoid the performance cost, but I also don't recommend that.
In summary:
If you have some state which only needs to be used by a single closure, just move it. This has no performance cost, and it's very convenient.
If you have some state which needs to be shared between multiple closures, then you will pay a performance cost. The performance cost is extremely small, so it's not worth worrying about.
To put it into perspective, Rc does a single heap-allocation, and RefCell does an integer check and integer set. In contrast, every object in JavaScript is heap-allocated, and the overhead is generally much more than an integer check/set!

Wow this write-up was excellent. Thanks for some of the rust background.
The additional option of lazy_static is one I did not think of. I'm also not informed of the differences between RefCell and Cell, so I can read up on that in my own time.
These statements were pretty helpful for me:

If you have some state which needs to be shared between multiple closures, then you will pay a performance cost. The performance cost is extremely small, so it's not worth worrying about.

To put it into perspective, Rc does a single heap-allocation (when the Rc is created), and RefCell does an integer check and integer set (every time that you call borrow or borrow_mut).

Again, I did not know too much about how well RefCell is implemented. If it does a simple int set/clr then I already feel a lot better about using it.
One reason I could see for preferring state stay on the stack is that you might get better performance accessing a reference on the stack than an object on heap. It may be trivial, and it may be a wasm browser implementation detail.
Some additional thoughts:
The 'static requirement is strict. I wonder if you could tie the lifetime requirement to the lifetime of a event listener token that gets returned to you from add_event_listener. If an event_listener was tied to to the lifetime of a corresponding event_listener_token, then the listener would automatically detach when the token goes out of scope. You could then have the lifetime of stack state depend on the lifetime of the token.
Thanks, and keep up the good work!

Again, I did not know too much about how well RefCell is implemented. If it does a simple int set/clr then I already feel a lot better about using it.

I personally find it very enlightening to read the source code for the standard library. Everything's in Rust, so it's usually quite easy to read.

First, you find the thing you're interested in.

Then you click the [src] button, which shows you the source code.

Then you poke around, investigate things, etc.

In the case of RefCell, you can see that it contains a Cell (which is a way of mutating things that has no performance cost).
When you call borrow_mut, it creates a BorrowRefMut, which contains a reference to the RefCell's Cell. This will all get inlined away, so don't worry about any overhead.
When it creates the BorrowRefMut, it does an integer check to make sure that the Cell isn't currently being used, and then it mutates the Cell to WRITING (which is an integer which indicates that the RefCell is currently being used).
And that's pretty much it! It might seem like a lot of code, but because it's all inlined it will end up being extremely small and fast.

One reason I could see for preferring state stay on the stack is that you might get better performance accessing a reference on the stack than an object on heap. It may be trivial, and it may be a wasm browser implementation detail.

I'm not 100% sure, but I'm pretty sure there's zero difference between accessing a stack reference and a heap reference. They both end up going into the wasm linear memory (just in different spots).

The 'static requirement is strict.

It both is and it isn't. It's extremely annoying when you first find out about it, but after you get used to using Rc + RefCell then it isn't that big of a deal, just a minor annoyance.
For my own programs, I usually create a single State struct which contains everything I need, and then I put it into an Rc, and then I use Cell / RefCell for the individual fields:
struct State {
    foo: Cell<bool>,
    bar: RefCell<String>,
}

fn main() {
    let state = Rc::new(State {
        foo: Cell::new(false),
        bar: RefCell::new("".to_owned()),
    });
}

I also created a simple clone! macro which makes it easy to clone things:
foo.add_event_listener(clone!(state => move |e: MouseClickEvent| {
    state.foo.set(true);

    let bar = state.bar.borrow_mut();

    // ...
}));

This significantly improves the ergonomics of using Rc / Cell / RefCell.
Alternatively, rather than putting RefCell / Cell on individual fields, you can use Rc<RefCell<State>>, which is also completely fine.

I wonder if you could tie the lifetime requirement to the lifetime of a event listener token that gets returned to you from add_event_listener. If an event_listener was tied to to the lifetime of a corresponding event_listener_token, then the listener would automatically detach when the token goes out of scope. You could then have the lifetime of stack state depend on the lifetime of the token and you would never worry about a use-after-free.

It's a great idea (which I had thought about before), but unfortunately it doesn't work. Consider this simple example:
let mut x = "foobar";

let listener = foo.add_event_listener(|e| {
    x = "quxcorge";
});

std::mem::forget(listener);

In this case we're using std::mem::forget to leak the event listener token, which means the event listener is never cleaned up, which means the event listener outlives the stack.
There's many ways to leak things in Rust (including Rc cycles), std::mem::forget is just one of them. So banning/avoiding std::mem::forget isn't enough.
The exact same problem happened with thread::scoped (which was used to access stack variables in other threads). They had implemented it with a JoinGuard<'a>, which was supposed to tie the thread to the stack lifetime. But because it's possible to leak the JoinGuard<'a> that caused use-after-free bugs.
Also, even if we could tie the event listener token to the stack, it wouldn't be as useful as you might think. Consider this example:
fn add_listener<'a>(foo: &'a Node) -> EventListener<'a> {
    let mut x = "foobar";

    let listener = foo.add_event_listener(|e| {
        x = "quxcorge";
    });

    listener
}

In this case we're returning the EventListener token, so the EventListener token outlives the add_listener function. But the event listener is accessing the variable x, which will be destroyed when the add_listener function returns. In this case Rust will correctly give a compile-time error telling you that the event listener outlives the variable x.
And if you create the listeners in the main function, you end up with a different problem:
fn main() {
    let foo = ...;

    let mut x = "foobar";

    let listener1 = foo.add_event_listener(|e| {
        x = "quxcorge";
    });

    let listener2 = foo.add_event_listener(|e| {
        x = "quxcorge";
    });
}

In this case the event listener tokens are tied to the stack, so as soon as the main function returns the event listeners will be removed. Since the main function returns immediately after creating the event listeners, that means the event listeners will be immediately removed and will never fire.

Then you click the [src] button, which shows you the source code.
Wow I did not know this was a thing! This will be my new favorite link when browsing rust docs.

I'm not 100% sure, but I'm pretty sure there's zero difference between accessing a stack reference and a heap reference. They both end up going into the wasm linear memory (just in different spots).

This makes a lot of sense. I assumed it might not matter due to implementation details like the linear memory.
...
Holy cow you must have spent sometime putting that last explanation together. I really appreciate it. I think I can learn to live comfortably using the Cells.

Sure, I'm glad I was able to help.


ocamlPackages.tsdl: 0.9.4 -> 0.9.7

From the release notes:

Require OCaml 4.03 and handle stdlib deprecations.
Drop result depency.
Drop ocb-stubblr dependency
The library has also been re-licensed fro BSD3 to ISC

Things done

[x] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[x] NixOS (x86-64)

[x] Ensured that relevant documentation is up to date
[x] Fits CONTRIBUTING.md.

In addition, I confirmed I could run #require "tsdl";; in an ocaml repl and access the module values.

@GrahamcOfBorg build ocamlPackages.tsdl


Setup new templates folder per template set in https://github.com/devonfw/cobigen/tree/master/cobigen-templates and split context.xml

The idea discussed in a first meeting was to remove the context.xml from the root folder and put the triggers directly in the subfolders. Either as a separate context.xml file in the subfolder or inside the templates.xml file.

CLI-tests use the currently deployed templates, therefore the current tests will fail the moment we deploy the new folder structure. the way CLI-tests work need to be changed, otherwise we can't create tests using the old folder structure and because of that can't test the backward compatibility.

After more consideration, this is the folder structure we decided to use for now.
The Cobigen_Templates folder should contain any number of folders for template sets which contain a context and templates xml each as well as the templates in some way as would be denoted in the config files. The utils would stay completely seperate from the template sets and would be downloaded seperately (possibly prompting the user to download if they don't exist yet).

The config files should always be top level in the TemplateSet folder, so situations like the following image would have to be avoided. This makes it easier to search for the config files (no searching in sub-folders required) and is kept in the spirit of modular templates, since you should only be able to download singular template sets.

In the future, the following might be a better solution that could be reached with multiple tweaks/extensions to the above solution.
Just as in the previous comment, the Cobigen_Templates folder would contain any number of template sets, though there are no longer two config files on the top level, but one instead that contains the info of both files.
Additionally, not all utils would be downloaded at once, but instead each template set would have individual utils needed denoted in its config file.

Another proposed solution was to split up the util classes and use what each template sets needs in a new util file in each template set folder (no global utils).
This was disregarded for now, since there would be quite a bit of code duplication as many templates use the same util methods.


Remove explicit IDE1005 suppressions

Partially revert changes to Microsoft.Management.UI.Internal as analyzers are skipped since #15677

@adityapatwardhan Can we merge?


build: Include v1 branch in the branches to build

@nicojs should we push this to master or only the v1 branch? Currently, it's linked to the master branch.


Failure on arm32 machine

Hi, I've been using the old qmcgaw/cloudflare-dns-server and today I've found that the new qmcgaw/dns is available. The new docker image works fine on most of my systems except one:
It's Synology DS416j NAS which does not officially support docker, with Marvell Armada (armhf) CPU. But docker for arm32v7 works anyway with limited functionality, and the old qmcgaw/cloudflare-dns-server works fine with two obligatory options:
--network=host
--user=root
The problem is that the new qmcgaw/dns ends up with failure with messages as below:
2021/06/26 11:00:34 INFO Unbound version: 1.13.0
2021/06/26 11:00:34 INFO Settings summary:
 |--Unbound settings:
    |--DNS over TLS providers:
        |--Cloudflare
    |--Listening port: 53
    |--Access control:
        |--Allowed:
            |--<IP_ADDRESS>/0
            |--::/0
    |--Caching: enabled
    |--IPv4 resolution: enabled
    |--IPv6 resolution: disabled
    |--Verbosity level: 1/5
    |--Verbosity details level: 0/4
    |--Validation log level: 0/2
    |--Username:
 |--Blacklisting settings:
    |--Blocked categories: malicious, surveillance, ads
    |--Hostnames unblocked: 1
    |--Additional IP networks blocked: 13
 |--Check DNS: enabled
 |--Update: every 24h0m0s
2021/06/26 11:00:34 INFO using DNS address <IP_ADDRESS> internally
2021/06/26 11:00:34 INFO generating Unbound configuration
2021/06/26 11:00:34 INFO starting unbound
2021/06/26 11:00:34 INFO healthcheck server: listening on <IP_ADDRESS>:9999
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:0] warning: setrlimit: Operation not permitted
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:0] warning: cannot increase max open fds from 1024 to 8266
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:0] warning: continuing with less udp ports: 477
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:0] warning: increase ulimit or decrease threads, ports in config to remove this warning
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:0] notice: init module 0: validator
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:0] notice: init module 1: iterator
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:0] info: start of service (unbound 1.13.0).
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:1] error: ssl handshake failed crypto error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:1] error: and additionally crypto error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:1] error: and additionally crypto error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:1] error: and additionally crypto error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:1] error: and additionally crypto error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:1] notice: ssl handshake failed <IP_ADDRESS> port 853
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:1] error: ssl handshake failed crypto error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:1] error: and additionally crypto error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:1] error: and additionally crypto error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:1] error: and additionally crypto error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time
2021/06/26 11:00:34 INFO [8573204612050321408] unbound[13:1] error: and additionally crypto error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
2021/06/26 11:00:34 WARN Caught OS signal, shutting down
2021/06/26 11:00:34 WARN healthcheck server: shutting down (context canceled)
2021/06/26 11:00:34 WARN healthcheck server: shut down
2021/06/26 11:00:39 WARN Shutdown timed out

In fact, the ssl handshake failure is repeated endlessly and the last part of the messages are the result of my interruption with ctrl+c.

See https://github.com/qdm12/gluetun/wiki/32-bit-setup
Alternatively use qmcgaw/dns:v2.0.0-beta
I'll close the issue once I add documentation for it, thanks!

I've tried qmcgaw/dns:v2.0.0-beta and it ended up with error:
docker: Error response from daemon: linux spec user: unable to find user root: no matching entries in passwd file.

Ah maybe remove the --user flag you pass to your Docker command? The container runs on Scratch (no OS) with v2 so there is no user names. Alternatively you can use user ids. Note that you shouldn't run containers as root, ideally leave it to the default user ID 1000 (so don't specify any user).

I had already tried that and the error messages look like this:
2021/06/27 04:19:08 INFO using DNS address <IP_ADDRESS> internally
2021/06/27 04:19:08 INFO healthcheck server: listening on <IP_ADDRESS>:9999
2021/06/27 04:19:08 INFO starting DNS server
2021/06/27 04:19:08 INFO DNS server listening on :53
2021/06/27 04:19:14 INFO unbound loop exited
2021/06/27 04:19:14 WARN healthcheck server: shutting down (context canceled)
2021/06/27 04:19:14 ERROR DNS server shutdown error: dns: server not started
2021/06/27 04:19:14 ERROR DNS is not working after 10 tries: lookup github.com on <IP_ADDRESS>:53: read udp <IP_ADDRESS>:53983-><IP_ADDRESS>:53: read: connection refused
2021/06/27 04:19:14 INFO Shutdown successful
Maybe it's time to abandon my old NAS... (frustrated)

Please don't 😉 You're helping me fix my program for your architecture, it's pretty useful, if that can motivate you!
Now these logs are from the latest or v1.x.x image, are you sure you are running that qmcgaw/dns:v2.0.0-beta image?
If you can please create another issue if the openssl error (due to the 32 bit) is fixed now, that would be great, thanks!

Thanks that you're willing to help me. :)
I don't understand your point when you mentioned openssl, but the entire messages with my docker command is as below:
docker run --rm --network=host --name cloudflare0 qmcgaw/dns:v2.0.0-beta
=========================================
========= DNS over TLS container ========
=========================================
=== Made with ❤  by github.com/qdm12 ====
Running version v2.0.0-beta built on 2021-05-15T17:25:05Z (commit 83c928e)
🔧  Need help? https://github.com/qdm12/dns/issues/new
💻  Email<EMAIL_ADDRESS>☕  Slack? Join from the Slack button on Github
💸  Help me? https://github.com/sponsors/qdm12
2021/06/27 04:32:02 WARN Environment variable "IPV6" is deprecated, use the following instead: DOT_CONNECT_IPV6
2021/06/27 04:32:02 WARN Environment variable "IPV4" is deprecated, use the following instead: DOT_CONNECT_IPV6
2021/06/27 04:32:02 INFO Settings summary:
|--Upstream type: DoT
|--DoT settings:
|--Resolver:
|--DNS over TLS providers:
|--Cloudflare
|--Google
|--Fallback plaintext DNS providers:
|--Cloudflare
|--Query timeout: 3s
|--Connecting over: IPv4
|--Listening port: 53
|--Caching:
|--Type: lru
|--Max entries: 10000
|--Blacklist:
|--Blacklisting is disabled
|--Blacklist settings:
|--Blocked categories: malicious
|--Additional IP networks blocked: 13
|--Check DNS: enabled
|--Update: every 24h0m0s
|--Log level: INFO
|--Query log settings:
|--Status: disabled
2021/06/27 04:32:02 INFO healthcheck server: listening on <IP_ADDRESS>:9999
2021/06/27 04:32:02 INFO using DNS address <IP_ADDRESS> internally
2021/06/27 04:32:02 INFO starting DNS server
2021/06/27 04:32:02 INFO DNS server listening on :53
2021/06/27 04:32:07 INFO unbound loop exited
2021/06/27 04:32:07 WARN healthcheck server: shutting down (context canceled)
2021/06/27 04:32:07 ERROR DNS server shutdown error: dns: server not started
2021/06/27 04:32:07 ERROR DNS is not working after 10 tries: lookup github.com on <IP_ADDRESS>:53: read udp <IP_ADDRESS>:50010-><IP_ADDRESS>:53: read: connection refused
2021/06/27 04:32:07 INFO Shutdown successful

Now these logs are from the latest or v1.x.x image, are you sure you are running that qmcgaw/dns:v2.0.0-beta image?

I changed in 904c5d08cbb62f013b9cdc7021fc688e067d2415 the unbound loop name to run loop since there is no more unbound, that's why it confused me on my phone thinking you were still running v1.x.x sorry!

I don't understand your point when you mentioned openssl

unbound[13:1] error: and additionally crypto error:0D0D90AD:asn1 encoding routines:ASN1_TIME_adj:error getting time to fix this use what's documented here; But also I recommended the alternative to use :v2.0.0-beta so never mind, my bad! 😄

with my docker command

I think --network=host is at fault. You should really not run this as host, there is not much point to do it anyway 😉 First try with:
docker run -it --rm --name cloudflare0 -p 53:53/udp qmcgaw/dns:v2.0.0-beta

And see if it crashes as well?

and the error messages look like this

Also for your own information, the log lines order is not intuitive, since everything in the code is quite asynchronous/parallel. From cause to effect it is actually:
2021/06/27 04:32:07 ERROR DNS is not working after 10 tries: lookup github.com on <IP_ADDRESS>:53: read udp <IP_ADDRESS>:50010-><IP_ADDRESS>:53: read: connection refused
2021/06/27 04:32:07 ERROR DNS server shutdown error: dns: server not started
2021/06/27 04:32:07 INFO unbound loop exited
2021/06/27 04:32:07 WARN healthcheck server: shutting down (context canceled)
2021/06/27 04:32:07 INFO Shutdown successful

So really the DNS server gets shutdown because the try to resolve github.com did not work out. For some reason it seems the DNS did not manage to start, not sure why though.

I think --network=host is at fault. You should really not run this as host, there is not much point to do it anyway 😉 First try with:
docker run -it --rm --name cloudflare0 -p 53:53/udp qmcgaw/dns:v2.0.0-beta

Bridge network does not work on my old system. Interactive terminal for docker containers does not work either. It's kernel limitations, according to the link below:
https://stackoverflow.com/questions/52520008/can-i-install-docker-on-arm8-based-synology-nas
Now I'm really thinking of installing linux on my old i386 laptop and replace the arm32 NAS.

Let's continue the discussion on https://github.com/qdm12/dns/discussions/80 for that.
For the error you see, my feeling is that there is already something listening on port 53 so the container fails to listen on it. Although it should log out something about it, I'll investigate why.
Anyway, you can try finding if something listens on port 53 with for example lsof -i -P -n | grep LISTEN

For the error you see, my feeling is that there is already something listening on port 53 so the container fails to listen on it. Although it should log out something about it, I'll investigate why.
Anyway, you can try finding if something listens on port 53 with for example lsof -i -P -n | grep LISTEN

My system does not support lsof command, but the old version qmcgaw/cloudflare-dns-server works fine on port 53. Of course I closed the old version before I try the new one.

It should work with qmcgaw/dns:v1.5.0 as well since it uses alpine 3.12 and since you can't upgrade Docker/libseccomp2 on your host. I'll investigate why v2 doesn't work and get back to you. I will also build you a special image based on Alpine 3.12 too with the latest v1 version.

Thank you. v1.5.0 ends up saying that it does not have permission to open port 53.
Then I've tried with the option --user=root and it seems to work, but it actually partly works: sometimes (or many times) it does not reply to a domain name request.
The messages are as below:
2021/06/28 14:04:40 INFO using DNS address <IP_ADDRESS> internally
2021/06/28 14:04:40 INFO generating Unbound configuration
2021/06/28 14:04:40 INFO starting unbound
2021/06/28 14:04:40 INFO healthcheck server: listening on <IP_ADDRESS>:9999
2021/06/28 14:04:40 INFO [1624889080] unbound[13:0] warning: setrlimit: Operation not permitted
2021/06/28 14:04:40 INFO [1624889080] unbound[13:0] warning: cannot increase max open fds from 1024 to 8266
2021/06/28 14:04:40 INFO [1624889080] unbound[13:0] warning: continuing with less udp ports: 477
2021/06/28 14:04:40 INFO [1624889080] unbound[13:0] warning: increase ulimit or decrease threads, ports in config to remove this warning
2021/06/28 14:04:40 INFO [1624889080] unbound[13:0] notice: init module 0: validator
2021/06/28 14:04:40 INFO [1624889080] unbound[13:0] notice: init module 1: iterator
2021/06/28 14:04:40 INFO [1624889080] unbound[13:0] info: start of service (unbound 1.10.1).
2021/06/28 14:04:40 INFO [1624889080] unbound[13:0] info: generate keytag query _ta-4a5c-4f66. NULL IN
2021/06/28 14:04:40 INFO restarting Unbound the first time to get updated files
2021/06/28 14:04:40 INFO downloading DNSSEC root hints and named root
2021/06/28 14:04:45 INFO downloading and building DNS block lists
2021/06/28 14:04:47 INFO 350398 hostnames blocked overall
2021/06/28 14:04:47 INFO 402 IP addresses blocked overall
2021/06/28 14:04:47 INFO 2490 IP networks blocked overall
2021/06/28 14:04:47 INFO generating Unbound configuration
2021/06/28 14:04:47 INFO starting unbound
2021/06/28 14:04:48 INFO [1624889088] unbound[17:0] warning: setrlimit: Operation not permitted
2021/06/28 14:04:48 INFO [1624889088] unbound[17:0] warning: cannot increase max open fds from 1024 to 8266
2021/06/28 14:04:48 INFO [1624889088] unbound[17:0] warning: continuing with less udp ports: 477
2021/06/28 14:04:48 INFO [1624889088] unbound[17:0] warning: increase ulimit or decrease threads, ports in config to remove this warning
2021/06/28 14:04:52 INFO [1624889092] unbound[17:0] notice: init module 0: validator
2021/06/28 14:04:52 INFO [1624889092] unbound[17:0] notice: init module 1: iterator
2021/06/28 14:04:52 INFO [1624889092] unbound[17:0] info: start of service (unbound 1.10.1).
2021/06/28 14:04:52 INFO [1624889092] unbound[17:1] info: generate keytag query _ta-4a5c-4f66. NULL IN

Do you see in the logs what's the Unbound version for

qmcgaw/dns:v1.5.0
your older qmcgaw/cloudflare-dns-server image

I see quite a few warnings that I have not seen like setrlimit: Operation not permitted or cannot increase max open fds from 1024 to 8266 🤔
Anyway, give me a few hours, I'll see why v2 doesn't work in your situation. v2 does not depend on anything really, it's just a single binary without even an operating system so it should be working better anyway on corner cases hosts like yours.

Please find below the messages from qmcgaw/cloudflare-dns-server. Surprisingly, it's almost the same: the same unbound 1.10.1, the same 'setrlimit: Operation not permitted' error, 'cannot increase max open fds from 1024 to 8266' error:
2021-06-28T21:25:05.090Z	INFO	healthcheck server: listening on <IP_ADDRESS>:9999
2021-06-28T21:25:05.091Z	INFO	using DNS address <IP_ADDRESS> internally
2021-06-28T21:25:05.092Z	INFO	generating Unbound configuration
2021-06-28T21:25:05.093Z	INFO	starting unbound
2021-06-28T21:25:05.109Z	INFO	[1624915505] unbound[11:0] warning: setrlimit: Operation not permitted
2021-06-28T21:25:05.109Z	INFO	[1624915505] unbound[11:0] warning: cannot increase max open fds from 1024 to 8266
2021-06-28T21:25:05.109Z	INFO	[1624915505] unbound[11:0] warning: continuing with less udp ports: 477
2021-06-28T21:25:05.110Z	INFO	[1624915505] unbound[11:0] warning: increase ulimit or decrease threads, ports in config to remove this warning
2021-06-28T21:25:05.158Z	INFO	[1624915505] unbound[11:0] notice: init module 0: validator
2021-06-28T21:25:05.170Z	INFO	[1624915505] unbound[11:0] notice: init module 1: iterator
2021-06-28T21:25:05.207Z	INFO	[1624915505] unbound[11:0] info: start of service (unbound 1.10.1).
2021-06-28T21:25:05.463Z	INFO	[1624915505] unbound[11:0] info: generate keytag query _ta-4a5c-4f66. NULL IN
2021-06-28T21:25:05.464Z	INFO	[1624915505] unbound[11:1] info: generate keytag query _ta-4a5c-4f66. NULL IN
2021-06-28T21:25:05.716Z	INFO	restarting Unbound the first time to get updated files
2021-06-28T21:25:05.716Z	INFO	downloading DNSSEC root hints and named root
2021-06-28T21:25:11.502Z	INFO	downloading and building DNS block lists
2021-06-28T21:25:14.837Z	INFO	350398 hostnames blocked overall
2021-06-28T21:25:14.838Z	INFO	2892 IP addresses blocked overall
2021-06-28T21:25:14.838Z	INFO	generating Unbound configuration
2021-06-28T21:25:15.305Z	INFO	starting unbound
2021-06-28T21:25:16.698Z	INFO	[1624915516] unbound[18:0] warning: setrlimit: Operation not permitted
2021-06-28T21:25:16.698Z	INFO	[1624915516] unbound[18:0] warning: cannot increase max open fds from 1024 to 8266
2021-06-28T21:25:16.699Z	INFO	[1624915516] unbound[18:0] warning: continuing with less udp ports: 477
2021-06-28T21:25:16.700Z	INFO	[1624915516] unbound[18:0] warning: increase ulimit or decrease threads, ports in config to remove this warning
2021-06-28T21:25:19.785Z	INFO	[1624915519] unbound[18:0] notice: init module 0: validator
2021-06-28T21:25:19.786Z	INFO	[1624915519] unbound[18:0] notice: init module 1: iterator
2021-06-28T21:25:19.827Z	INFO	[1624915519] unbound[18:0] info: start of service (unbound 1.10.1).
2021-06-28T21:25:22.344Z	INFO	[1624915522] unbound[18:0] info: generate keytag query _ta-4a5c-4f66. NULL IN

Try :v1.5.1, sorry v1.5.0 had a bug in there I think. I didn't have time to dig into why :v2.0.0-beta doesn't work, maybe try running it with --user="0" (as root)?

Thank you. v.1.5.1 seems to work fine.
And v.2.0.0.-beta with the option --user="0" works well without any error nor warning!

Alright nice!
It was probably the same error for :v2.0.0-beta where it could not bind to port 53 without root on your system.
On both images, we use libcap to set low port binding capability on the binary (unbound for v1, and the Go program I wrote for v2) with setcap 'cap_net_bind_service=+ep' unbound. This way the container can run by default without root (safer) and have only that capability (low port number binding).
My guess is your older Docker and/or Kernel do not like that fiddling 😉  I've added a warning to the readme advising to run it as root if you run an old Docker or kernel (https://github.com/qdm12/dns/commit/5b48b7ff01b92ab0cdd8c3ee2ff26adc6934b749)
Closing the issue 👍


Generic Install on OpenShift Container - error:superset.views.base:'NoneType' object has no attribute 'id'

After a successful installation in Docker using the 'pip install apache-superset'; I've tried running the same install but this time in OpenShift.
I have successfully pushed the image into OpenShift, I can access the login page successfully...
Expected Results:
Should be able to login.
Actual Results:
error:superset.views.base:'NoneType' object has no attribute 'id' Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/flask/app.py",
line 1950, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py",
line 1936, in dispatch_request return self.view_functionsrule.endpoint File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/views.py",
line 516, in login user = self.appbuilder.sm.auth_user_db( File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/manager.py",
line 874, in auth_user_db self.noop_user_update(first_user) File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/sqla/manager.py",
line 244, in noop_user_update .where(self.user_model.id == user.id)
How to reproduce:
Follow this guide... https://superset.apache.org/docs/installation/installing-superset-from-scratch
PostGres - Setup
Config - Setup
Any help would be appreciated.
Thanks!

Hey there, moving to Discussion so hopefully someone in the community will help with debugging 🙏 If there's a clear bug you can help the community reproduce, then definitely open a Github Issue!


AuditEntry class mapping

Hi!
It would be nice to have some way by configuring to replace the AuditEntry entity with some other entity. Since AuditReader always returns instances of AuditEntry and it is not possible to give behavior to this class unless it is its own.
Something like:
`
dh_doctrine_audit:
    audit_entry:
        class: App\Entity\CustomAuditEntry

`

@rubiodamian that would be a nice addition, may you submit a PR?


Added the Cursor Trail Effect

The Cursor Trail Effect is added to improve UI.  A small black/white circle follows the cursor as it moves across the page, creating a more engaging UI.

Please resolve the merge conflicts

@hars-21
Hello, I've resolved the conflict, now it do not have any conflicts.
Kindly merge it and assign me the labels too!!
Thank you!!
fixes: #367

@Piyush01-672 There are so many conflicts Please make a new PR


update mqtt watcher disconnect problem

Cluster.Watcher().Watch() may disconnect due to multiple problems.
So, when disconnect, we reconnect watcher and update events during reconnect period.

Codecov Report

Merging #394 (0793c99) into new-pipeline (82a4ac7) will decrease coverage by 0.29%.
The diff coverage is 18.03%.

@@               Coverage Diff                @@
##           new-pipeline     #394      +/-   ##
================================================
- Coverage         80.28%   79.98%   -0.30%
================================================
  Files                62       62
  Lines              6998     7043      +45
================================================
+ Hits               5618     5633      +15
- Misses             1074     1101      +27
- Partials            306      309       +3

Impacted Files
Coverage Δ

pkg/object/mqttproxy/mqttproxy.go
15.78% <0.00%> (-0.43%)
:arrow_down:

pkg/object/mqttproxy/broker.go
73.24% <15.55%> (-6.29%)
:arrow_down:

pkg/object/mqttproxy/storage.go
73.23% <23.07%> (-3.58%)
:arrow_down:

pkg/object/mqttproxy/backend.go
68.53% <100.00%> (ø)

pkg/object/mqttproxy/session.go
82.20% <0.00%> (+7.97%)
:arrow_up:

Continue to review full report at Codecov.

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


added types

As part of HedgeDoc we wrote these type definitions to use the plugin, but we think they would have a far better home in this repository.

Please commit to DefinetlyTyped (as been done for markdown-it). We do not use TS and are unable to maintain that properly.


deps: Bump com_github_cncf_udpa (cncf/xds)

Signed-off-by: Sergii Tkachenko<EMAIL_ADDRESS>
Commit Message: deps: Bump com_github_cncf_udpa (cncf/xds)
Additional Description: Updating to the latest cncf/xds main as of 2022-05-18 to get CEL matcher and CEL Expression APIs. Will be needed for #9793. Full changelog:  https://github.com/cncf/xds/compare/7f1daf1720fc185f3b63f70d25aefaeef83d88d7...d35b9e6a8854c8e612568e0fadee9414d54e1288.
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]
FYI @markdroth @kyessenov

@yanavlasov @kyessenov Added envoy.matching.inputs.http_attributes to extension to builtins. This fixed the format_pre build job, but I don't know if this is something you actually want. See https://github.com/envoyproxy/envoy/pull/21366/commits/c428805a37ec09836f1c425854ce0c2a44dcc1fb.

/lgtm deps

cc @tyxia

I think you should wait to add an extension name to the manifest until the extension is implemented. Adding a protobuf specification does not require updating the extension manifest.

@kyessenov without it, it the build was failing. Looks like Azure already removed the result. Let me try and reproduce the error.

Ok, ifI don't add it to source/extensions/extensions_metadata.yaml, target //docs:html fails with
Did you forget to add 'envoy.matching.inputs.http_attributes' to extensions_build_config.bzl, extensions_metadata.yaml, contrib_build_config.bzl, or contrib/extensions_metadata.yaml?

And when I add it to source/extensions/extensions_metadata.yaml, but not to tools/extensions/extensions_schema.yaml, then //tools/code:check fails:
CodeChecker NOTICE [extensions_metadata] Checks (182) completed successfully
CodeChecker NOTICE [extensions_registered] Running check...
CodeChecker ERROR [extensions_registered] Metadata for unused extension found: envoy.matching.inputs.http_attributes
CodeChecker ERROR [extensions_registered] Check failed

Here's how HttpAttributesCelMatchInput docs built from the last commit look like:

/lgtm deps
And all other aspects seem to clear review.


Joseph chretien

BST added

@JGolden25 I am not sure what this PR is about.

just setting up GH with my excercises

@JGolden25 I suggest you use the exercism CLI tool to download exercises and initialize a github repo in that root folder. You're currently pushing your solutions to our maintainers repository.


⚠ Bofrost.es has degraded performance

In ac7ddc5, Bofrost.es (https://www.bofrost.es) experienced degraded performance:

HTTP code: 200
Response time: 1613 ms

Resolved: Bofrost.es performance has improved in 2577f2c after 308 days, 17 hours, 25 minutes.


🐛 [firebase_performance] Firebase performance crashes if referenced from multiple isolates (iOS)

Bug report
The plugin will fail when attempting to handle methods called from separate Dart isolates. This is likely due to the fact that the plugin relies on a static dictionary for method handlers in FLTFirebasePerformancePlugin.m
Steps to reproduce
Create and interact with an HttpMetric on the main isolate and a background isolate.
Expected behavior
The app does not crash.
Stacktrace
Last Exception Backtrace:
0   CoreFoundation                	0x18386adc0 __exceptionPreprocess + 220 (NSException.m:199)
1   libobjc.A.dylib               	0x1983c27a8 objc_exception_throw + 60 (objc-exception.mm:565)
2   Runner                        	0x1031d4bf8 +[FLTFirebasePerformancePlugin addMethodHandler:methodHandler:] + 264 (FLTFirebasePerformancePlugin.m:48)
3   Runner                        	0x1031d45ac -[FLTFirebasePerformance newHttpMetric:result:] + 440 (FLTFirebasePerformance.m:65)
4   Runner                        	0x1031d40ec -[FLTFirebasePerformance handleMethodCall:result:] + 384 (FLTFirebasePerformance.m:0)
5   Runner                        	0x1031d4ac0 -[FLTFirebasePerformancePlugin handleMethodCall:result:] + 376 (FLTFirebasePerformancePlugin.m:38)
6   Flutter                       	0x104b84dc0 0x104698000 + 5164480
7   Flutter                       	0x1046d7f34 0x104698000 + 261940
8   Flutter                       	0x1049e0db4 0x104698000 + 3444148
9   Flutter                       	0x104986068 0x104698000 + 3072104
10  Flutter                       	0x104989098 0x104698000 + 3084440
11  CoreFoundation                	0x1837e58c0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32 (CFRunLoop.c:1807)
12  CoreFoundation                	0x1837e54bc __CFRunLoopDoTimer + 1076 (CFRunLoop.c:2415)
13  CoreFoundation                	0x1837e490c __CFRunLoopDoTimers + 328 (CFRunLoop.c:2575)
14  CoreFoundation                	0x1837de6c0 __CFRunLoopRun + 1944 (CFRunLoop.c:3090)
15  CoreFoundation                	0x1837dd9f4 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3242)
16  GraphicsServices              	0x19aeae734 GSEventRunModal + 164 (GSEvent.c:2259)
17  UIKitCore                     	0x18625b75c -[UIApplication _run] + 1072 (UIApplication.m:3269)
18  UIKitCore                     	0x186260fcc UIApplicationMain + 168 (UIApplication.m:4740)
19  Runner                        	0x1022e4834 main + 68 (AppDelegate.swift:25)
20  libdyld.dylib                 	0x183499cf8 start + 4

Hi @guymclean
Could you please provide your flutter doctor -v and flutter pub deps -- --style=compact?
It would be helpful if you could create a minimal complete reproducible code sample for this.
Thank you


Update install.md

Aligns docs to be able use multiple configs functionality with chains.d folder.

@blockpane could you look on it, please?


Pod updated to 1.1.1?

When will the pod be updated?  The pod still has the issue of the init being "internal" and therefore inaccessible to users of the pod.

I have updated the pod as well. Maybe it took some time to process. Can you please check again?
In the (parsed) documentation the initializer is visible already which means it must be public:
http://cocoadocs.org/docsets/AlignedCollectionViewFlowLayout/1.1.1/Classes/AlignedCollectionViewFlowLayout.html

My pod file says
pod 'AlignedCollectionViewFlowLayout'
And I get 1.1.0 with the problem on init
"initializer is inaccessible due to 'internall' protection level"
or something like that.
Btw, this is a really nice effort!

Thanks! I've just created a brand new Xcode project and added a podfile with pod "AlignedCollectionViewFlowLayout" as its only pod and ran pod install. Works for me.
It installs version 1.1.1 with the public initializer.
Please make sure you run pod update and not pod install.

I got it working now.  I thought I had done "pod update" at first but I must have done "pod install" out of habit.   When I add a new pod I try and remember the update...

Awesome. I'll close this issue.
(Generally, you don't need to run pod update when you add a new pod. In that case pod install is sufficient. You only need pod update in case you have an older version of a pod installed and want to update that pod to a higher version.)


add possible PolicyType values

closes https://github.com/MicrosoftDocs/office-docs-powershell/issues/11189

@JohanFreelancer9

@JohanFreelancer9

@yogkumgit this is still a draft.

@yogkumgit Waiting on internal information

@mineliza-ms can you please review? Thanks

https://github.com/MicrosoftDocs/office-docs-powershell/issues/11189#issuecomment-1796935834

@JohanFreelancer9

@tomkau Gentle reminder, kindly review. Thanks

@tiburd Please help. Thanks

@yogkumgit - are these changes still needed?


Readme now has a link to the wiki "Using Cardinal" page, hopefully results in less issues about "command missing" or "Missing Feature"

I have also written up the page on the wiki. Will add on commands as the features of Cardinal increase.
On a side note, how does one update the repo on github to the head fork?

Thanks!

@twizmwazin i have done this fist with more updates :/


Selecting Email Account from google_sign_in during Flutter integration testing

I was trying to test sign-in to my home screen for my flutter app. I am using the google-signin ( https://pub.dev/packages/google_sign_in) package from Flutter to perform login and authentication. So once the login button is pressed, a popup appears asking the user to select the user account. At that point, I am unable to control the tap as this dialog screen is generated by the plugin. How do I implement selection of the user account in this case ?
        test('Test Login', () async {
      final Timeline timeline = await driver.traceAction(() async {
        await driver.tap(find.byValueKey('GoogleLogin'));
        await driver.tap(find.text('myemail@gmail.com')); // This will not work !!!
      });

      TimelineSummary.summarize(timeline)
        ..writeSummaryToFile('home_scroll_perf', pretty: true)
        ..writeTimelineToFile('home_scroll_perf', pretty: true);
    });

In my opinion, this could be a problem when testing with any third party plugin. Please help.
https://stackoverflow.com/questions/58052343/selecting-email-account-from-google-sign-in-during-flutter-integration-testing

Sorry, this isn't a support site. I m sure you will get help at stackoverflow


fix: dropdown menu display on small screens

Checklist:

[X] I have read freeCodeCamp's contribution guidelines.
[X] My pull request has a descriptive title (not a vague title like Update index.md)

Closes #184

Contributors:
Co-authored by: Michelle Tan<EMAIL_ADDRESS>Co-authored by: Fadi Buni<EMAIL_ADDRESS>Before:

After:

Summary:
We edited a css property in the div tags for the modal where we used "overflow-auto" and "max-h-screen" to allow the user to scroll when the menu fills the screen.

LGTM, thanks!


bug - inner interface not generated as expected

I have these interfaces:
interface Person {
  age: number;
  persons: Person[]
}

interface Product {
  id: number;
  title: string;
}

persons generated data in string format.
should be in an array of objects Product

Nested objects are not supported. Feel free to submit a pull request. @jon9090


Feature Request: Supply set alarm times

Hello,
your component has been very useful for me. To further improve it, I'm suggesting the following new feature:
Since I'm using Alexa's alarm feature for waking up in the morning it would be great having access to the alarm time through home assistant. Then I would be able to create an automation that, for example, sets the heating or lights up the bedroom previously to the alarm ringing.
Do you think it would make sense to add such a feature to your component?

Should be possible; I just don't know what alarm components exist in HA.  Can you point to one?

@Walter-Bishop Is your goal only to know when an alarm or timer goes off? Or are you also interested in setting them?

I'm also really interested in this! Mostly interested in knowing when it goes off, to trigger other stuff in HA.

Would it work if you had to call a service to get the next alarm/timer time?  The API doesn't appear to report when the timer or alarm goes off so it's a little hackey to figure it out.

I would be fine with that, would just be a scheduled service call at like 3AM, so that you know the next mornings alarm if any, and then setup some other stuff based off that.

For me, just having the data available in a sensor entity would be useful.
https://alexa.amazon.com/api/notifications
The above API call will provide the reminders/alarms/timers information. Each of them includes an indication of which device it's set on via deviceSerialNumber. Exposing something like sensor.my_alexa_device_name_alarms, sensor.my_alexa_device_name_reminders, and sensor.my_alexa_device_name_timers that contained all of the data available from the API would be incredibly useful.
Even more... a service could be exposed to allow the setting of reminders. This is done with a PUT call to /api/notifications/createReminder with data like the following:
{
"type": "Reminder",
"status": "ON",
"alarmTime":<PHONE_NUMBER>000,
"originalTime": "15: 13: 00.000",
"originalDate": "2018-12-22",
"timeZoneId": null,
"reminderIndex": null,
"skillInfo": null,
"sound": null,
"deviceSerialNumber": "deviceSerialNumber",
"deviceType": "deviceType",
"recurringPattern": null,
"reminderLabel": "test",
"isSaveInFlight": true,
"id": "createReminder",
"isRecurring": false,
"createdDate":<PHONE_NUMBER>030
}
PUT and DELETE calls are also handled for /api/notifications/
I have a strong feeling that a PUT call to /api/notifications/createAlarm would work too, though I don't have sample JSON data for this yet.

Thanks. The issue isn't so much the API as I found it but figuring out the best way to represent it in HA. I asked the dev channel and didn't get a response. The existing calendars are using binary sensors so I might just do that.

That's a great idea! The sensor can be ON if there are any alarms, reminders, timers, and OFF if there are not. And then the actual data can be in the sensor attributes.

That would work perfectly, you can then trigger on the sensor change, and put the attribute in it's own sensor or use it some other way, either way, that will enable some truly smart stuff!

To follow the other calendars, each alarm would have its own binary sensor. Let me know if you see any issues with that method.
If anyone can confirm the calls for setting alarms, I can also see about adding that somehow.

The issue with each alarm having it's own sensor is that alarms are, by
nature, temporary. So we'd have sensors showing up and going away all the
time with no easy way to tell what the name of the next one will be.
With one sensor holding all the alarms for each echo device (one sensor per
device) automation code can easily iterate over them.
On Fri, May 24, 2019, 12:39 PM Alan Tse<EMAIL_ADDRESS>wrote:

To follow the other calendars, each alarm would have its own binary
sensor. Let me know if you see any issues with that method.
If anyone can confirm the calls for setting alarms, I can also see about
adding that somehow.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/keatontaylor/alexa_media_player/issues/144?email_source=notifications&email_token=AA7PP37FDBGJDTM345ZHZFLPXAR3RA5CNFSM4HCC6EN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWGCUCI#issuecomment-495725065,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA7PP33ODKXSWCGCMRX2EPDPXAR3RANCNFSM4HCC6ENQ
.

@dlashua Can you please provide some examples of how an automation could iterate through the data so I can see about what would be the best implementation?

An example is how the GoogleHome Alarm is displayed as a sensor within Homeassistant (see here). I personally don't like that it shows only the one next approaching but would prefer attributes with every alarm set...

an ordered queue would be fine, as long as there is a separate sensor for each device.
This way I can make an automation that says when it's 30 minutes until the alarm in the bedroom, start turning on the lights. When the alarm in the kitchen has been going off for 30 seconds without being stopped, start blinking the lights in the house.
For alarms, specifically, that's about as far as it goes since Alexa doesn't allow you to name alarms. Timers, however, can also have a name, so even more things could be done. Like, when my "dinner" timer in the kitchen sounds, announce on all devices "dinner is ready".

Hi, it would be very usefull for me to set alarm timers from Home Assistant

Can someone please help me to get the following sensor working:
- platform: command_line
  command:   '/usr/bin/curl -X GET https://alexa.amazon.com/api/notifications? -b<EMAIL_ADDRESS>  value_template: '{% if value_json.notifications[0].alarmTime is defined %}{{ value_json.notifications[0].alarmTime }}{% else %}none{% endif %}'

I want to use the cookie file of this custom component to get the alarm times. (In my browser it works with an active session)
Here, the curl doesn't seem to get any response from the server... Do I need any other Headers, Useragent etc?

@ronmichel I don't think you can use the pickle file like that. At least, just on plain command line, it doesn't work for me.
On top of that, even if it did work, the value_template needed to get a specific alarm from a specific echo device would be far too complicated. What you have there would only get the very first alarm's time, which may, in fact, be a timer, not an alarm, and, even if it is an alarm, might be turned off.
I have some working code that gets the most recent alarm time from each echo device and sets it as a sensor that you can access. However, it's written for AppDaemon (so that would be a requirement). And, as of right now (though I'm adding this feature next) it doesn't read alexa_media_player's pickle file, so you have to perform the captcha for it as well.
This code can't be used in a python_script because it imports alexapy which python_scripts don't allow. It could be made into a custom_component, though. However, it would be getting the devices list a second time, so it's really better off being integrated into alexa_media_player.

I have some working code

Hi @dlashua,
Do you have the code on your github? thanks

I have a working sensor now (@dlashua was right, the pickle can't be loaded into curl, it needs requests).
If anyone is interested:

Create /config/echoalarms.py with the following content:

#!/usr/bin/python3
import requests
import pickle

with<EMAIL_ADDRESS>'rb') as myfile:
    cookies = pickle.load(myfile)

session = requests.Session()

session.headers = {
    'User-Agent': ('Mozilla/5.0 (Windows NT 6.3; Win64; x64) '
                   'AppleWebKit/537.36 (KHTML, like Gecko) '
                   'Chrome/68.0.3440.106 Safari/537.36'),
    'Accept': ('text/html,application/xhtml+xml, '
               'application/xml;q=0.9,*/*;q=0.8'),
    'Accept-Language': '*'
}

session.cookies = cookies

response = session.get('https://alexa.amazon.XXX/api/notifications?&')

print(response.text)

Adapt the name of your pickle file and the amazon url to your data.
In your configuration.yaml add the following:

sensor:
  - platform: command_line
    name: EchoAlarms
    command: 'python3 /config/echoalarms.py'
    value_template: "{% if value_json.notifications is defined %}{{((value_json.notifications|selectattr('status', 'equalto','ON')|map(attribute='alarmTime')|list|sort|first/ 1000))|timestamp_local}}{% else %}false{% endif %}"
    json_attributes:
      - notifications

The state of the sensor is the next upcoming alarm Time. If you want any more information you can use the attribute "notifications" with all the available date for an additional Template sensor.

Can for sure be improved. Just a fast solution for me for the time being...

I used the alexapy library to make an AppDaemon based integration to find currently set alarms and set a sensor to that value for each echo device. It's not feature complete, so I'm not sharing the AppDaemon app just yet. But the central code that finds the alarms and builds a list of them might be useful to kickstart this feature in the alexa_media_player code base:
    def update_devices(self):
        self._devices = AlexaAPI.get_devices(self.login)

    def get_entity_by_name(self, name):
        return re.sub(r'([^\w])', '_', name).lower()

    def get_entity_by_sn(self, sn):
        return self.get_entity_by_name(self.get_name_by_sn(sn))

    def get_name_by_sn(self, sn):
        try:
            for d in self._devices:
                if d['serialNumber'] == sn:
                    return d['accountName']
        except Exception:
            return None

        return None

    def update_notifications(self):
        notifications = AlexaAPI.get_notifications(self.login)
        alarms = {}
        for n in notifications:
            entity = self.get_entity_by_sn(n['deviceSerialNumber'])
            alarm_time_obj = None
            if n['status'] != "ON":
                continue

            if n['originalDate'] is None:
                continue

            if n['originalTime'] is None:
                continue

            alarm_time_string = n['originalDate'] + " " + n['originalTime']
            alarm_time_obj = datetime.datetime.strptime(
                alarm_time_string,
                "%Y-%m-%d %H:%M:%S.%f"
            )

            data = {
                "entity": entity,
                "alarm": alarm_time_obj,
            }

            if entity in alarms and alarms[entity]['alarm'] is not None:
                if data['alarm'] is not None:
                    if alarms[entity]['alarm'] > data['alarm']:
                        alarms[entity] = data
            else:
                alarms[entity] = data

Thanks @dlashua. Is your sensor showing the next alarm or every alarm per device? I got stalled in trying to figure out the best way to show this but may be able to look at implementing this again now that async is done. You can tell when I got stalled because I added the underlying alexapy call but never implemented the feature. ;)
As a note, with the new aiohttp library, the cookie format has changed. It may be possible to use curl with it but I haven't tested.

I create one sensor per discovered device. There are other bits that look at "capabilities" returned by the device retrieval method and only add sensors if they have TIMERS_AND_ALARMS. The sensor is always set to the string of the next alarm for each device. It is False if there is no alarm. And I add a timestamp attribute with the epoch time to make the sensor usable in Home Assistant templates.
Also, in case it matters, this uses alexapy as it was maybe... 2 months ago. If there have been breaking changes since then, I've not kept it up to date.

Yah, we just moved alexapy to async so it's a breaking change at 1.0.0.

@alandtse
My sensor still works with 1.0
It shows the next alarm as the sensor state but all other alarms can be retreived in the sensor attributes.

@ronmichel it will probably work until 1.0.0 needs to create a new cookie. Then it'll save it in the aiohttp format which is the format that may work in curl. Requestcookies are different from standard cookies I think.

Just bought an echo show 5 to be used as an alarm clock. I would also like to get the alarms set  in to HA, so I can do more automation, like for example do wake-up lights. This would require HA knowing what time the alarm is set to.
The other way around, setting an Alexa alarm from HA would also be very handy.
You guys think this would be possible?

I have a version where it'll show the next alarm, reminder, and timer each as a separate sensor. In terms of showing all items, do you only want to see what is actually 'on' or everything?
If you've seen the notifications json, you'll notice that Amazon likes to create many items.

Just active ones for me @alandtse, since we set a different time most mornings we have a ton of alarms in the app and I wouldn't want all of those in my HA, just active ones!

@alandtse
Just the next upcoming alarm as one actual sensor for each device would be nice. The other (later or inactive) alarms could be implemented as sensor attributes (so anyone interested in the data could create template sensors for them)

Agree with @ronmichel on this!

Ok. Is there value in throwing an alarm going off event or would exposing the time be enough?
Sending an event will be guess work since there isn't a direct event from the API to monitor.

For me, just having the time is enough. If I need to know when it's going off I can make an automation that triggers at that exact time.

Also don’t see a use for sending events, especially if it isn’t easy to do. Once the time is in Hass, it’s easy enough to make an automation trigger.

For the adventurous and advanced users, there's a PR staged which also requires replacing alexapy. It exposes sensors for each device that will tell you the next active notification (alarm/timer/reminder). It also exposes attributes with a sorted list of all upcoming notifications or all notifications in the system. For those who are building template sensors, let me know if it needs any tweaking.
I'm looking at adding switches for enabling alarms/pausing timers or just doing a service call. That may make it in the next release or may be further along. May also look at adding the ability to add such notifications.

This is live in 2.3.0.

I'm assuming you mean the sensor.device_name_next_alarm entity. Mine doesn't seem to update after I've added an alarm to the device. Even though my custom code (that uses alexapy) sees the update. Thoughts?

I’ve seen this happening twice in my setup. The first time I tested the hell out of it and it worked every time, until I added an alarm with Spotify playlist on shuffle and the sensor would show no alarm. Even restarted, no go. Removed the alarm and set it the simplest way, instantly updated.
The second time it was a simple alarm, but it just wouldn’t update. Restarting Hass fixed it.

There's a bug for MusicAlarms. #402
One thing to check is whether you're seeing websocket requests for alexapy in the logs when editing alarms. If you aren't, then you're probably experiencing other update issues as we've lost the connection to the server.

ciao,
il mio "sensor.echo_living_next_alarm" ' status is 19:43:00+02:00 with the utc ,
it's not good for me to interact with some hassio automation, how can i remove "+02:00" to use it?
I thought I'd also use a template to read the "json" data in the description of the "sorted_active" attribute but I wasn't able to; tips?

By doing something like this:
{{ as_timestamp(states("sensor.echo_living_next_alarm"))| timestamp_custom('%d %b %Y at %H:%M') }}
or minutes to next alarm:
{{ (((as_timestamp(strptime(states("sensor.echo_living_next_alarm"), "%Y-%m-%d %H:%M:%S%z"))) - as_timestamp( strptime( now().strftime("%Y-%m-%d %H:%M:%S%z"), "%Y-%m-%d %H:%M:%S%z") )) / 60) | int}}

{{ as_timestamp(states("sensor.echo_living_next_alarm"))| timestamp_custom('%d %b %Y at %H:%M') }}

Thank You ! I will work on it :)

I created an issue:   https://github.com/custom-components/alexa_media_player/issues/409#issue-503702836

ok lo faccio! : Slight_smile:
questo è il mio test di automazione:
`automation:

alias: Sveglia CountDown
initial_state: 'on'
trigger:

platform: template
value_template: >-
{{ ((as_timestamp(strptime(states("sensor.echo_camera_next_alarm"), "%H:%M, %Y-%m-%d")) - (as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")))) / 60) | int  == 30 }}
action:
service: notify.telegram
data_template:
title: "Sveglia Alexa - {{ states('sensor.time') }}"
message: >-
Suonerà fra: {{ ((as_timestamp(strptime(states("sensor.echo_camera_next_alarm"), "%H:%M, %Y-%m-%d")) - (as_timestamp(strptime(states("sensor.time_date"), "%H:%M, %Y-%m-%d")))) / 60) | int }} minuti
alle: {{ as_timestamp(states.sensor.echo_camera_next_alarm.state) | timestamp_custom("%H:%M, %Y-%m-%d") }} - id: RQ Attiva Buongiorno
alias: "RQ Sveglia Attiva Buongiorno"
initial_state: 'on'
trigger:
platform: template
value_template: >-
{{ states.sensor.time_date.state == as_timestamp(states.sensor.echo_camera_next_alarm.state) | timestamp_custom("%H:%M, %Y-%m-%d") }}
action:
service: script.turn_on
data:
entity_id: script.rq_buongiorno`


Make CI/CD work as expected

#4 blocks this.

#4 is completed (except the mascot and the logos which do not block this), and CI/CD seems to work as expected with the rebranded packages. Are we done with this?

Yes, now it's done.


[Feature request] Support importing external private_key for CredentialBundle

Is your feature request related to a problem? Please describe.
Currently there is no way to pass an external private_key during creating of an CredentialBundle instance which does not allow for protocols where the private key is also used for features outside of MLS.
Describe the solution you'd like
An additional constructor in CredentialBundle which allows me to pass on a private_key via SignatureKeypair as a method argument.
Additional context
https://github.com/openmls/openmls/blob/main/openmls/src/credentials/mod.rs#L159

Hi @adzialocha,
thanks for the feature request! This is already on our TODO list and will be part of this project. In the short term, we could simply create a constructor that allows for this, but our current aim is to tackle this while dealing with the larger question of how to handle persistence for key material.


[Nim Con] switch to taskpools and general improvements

Alternative to and closes #351.
Independent of the PGO work in open PR #351, I was able to make the nim_com implementation more efficient.
I also found that by switching from malebolgia to taskpools, all available cores are better utilized[^1].
With these changes in nim_con/related_con.nim, clang or gcc PGO consistently decreases performance, so PGO is not used by default, i.e. run.sh invokes nim_con/build.sh instead of nim_con/buildopt.sh[^2].
With PGO not in the mix, the performance numbers seem to not bounce around too much.
For these changes, gcc builds perform better than clang builds.
It's now easy to switch compilers when invoking build.sh and buildopt.sh,  e.g. to use clang instead of gcc do ./build.sh clang.
A dumpHook is introduced for automatic use with/by the jsony library. Note that it does no more and no less work during the serialization step (i.e. after processing time is calculated) than jsony is already doing in single-threaded nim for ref types: jsony.nim#L851-L855.
[^1]: I think there's a bug in malebolgia because it's consistently saturating only N - 1 cores with N cores available. Or maybe that's by design to keep the main thread freed up in more complex synchronization scenarios, I'm not sure.
[^2]: I investigated the too-bouncy performance re: PGO builds, but didn't reach a firm conclusion.

In my Azure VM
docker run -it --rm -e GIT_REPO='https://github.com/michaelsbradleyjr/related_post_gen.git' -e BRANCH='nim_rev_8' -e TEST_NAME=nim_con databench

Nim Concurrent:

	Benchmark 1: ./build/related_con
	Processing time (w/o IO): 18.064ms
	Processing time (w/o IO): 18.974ms
	Processing time (w/o IO): 19.475ms
	Processing time (w/o IO): 17.769ms
	Processing time (w/o IO): 17.783ms
	Processing time (w/o IO): 20.04ms
	Processing time (w/o IO): 17.726ms
	Processing time (w/o IO): 17.819ms
	Processing time (w/o IO): 19.579ms
	Processing time (w/o IO): 18.075ms
	Processing time (w/o IO): 18.058ms
	Processing time (w/o IO): 19.383ms
	Processing time (w/o IO): 19.722ms
	 Time (mean ± σ):      44.7 ms ±   1.6 ms    [User: 86.8 ms, System: 7.4 ms]
	 Range (min … max):    42.5 ms …  47.4 ms    10 runs

Checking output
Success: related_posts_nim_con.json is valid!


python3Packages.gios: 2.0.0 -> 2.1.0

Motivation for this change
Update to latest upstream release 2.1.0
Change log: https://github.com/bieniu/gios/releases/tag/2.1.0
Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
21.11 Release Notes (or backporting 21.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.


Track master branch again

This patch unpinned from v1.7 and start tracking master again.
The master branch deprecated Retry (it has been 0 by default for
long time) so this patch removes it as well.

/cc @davidor @jmprusi @markusthoemmes

For reference, this is the issue that talks about deprecating the Retries field: https://github.com/knative/serving/issues/6549


hammerjs needs to be added to packages for systemjs as well

getting-started/Appendix: Configuring SystemJS:
it mentioned add hammerjs to mapping, does not say it needs to be added to packages too.

for workable example of using material 2, hammerjs in systemjs, check here

@Longfld can you rebase and we can work on reviewing and getting this in again?

This pull has been replaced by #10653

@josephperrott I have made #10653 to replace this(#v). Please review #10653 and get this in if proper, thanks!


feat: initialize apps from dart

Description
How it works

Maintain existing behaviour; Attempt to initialize default app on native, if no google-services.json or GoogleService-Info.plist (or if firebase.initializeApp() is not called from index.html for web ) is available, then dart will not have a default app.
Additional behaviour; once no default app is available, check if FirebaseOptions have been passed into initializeApp() (without the name parameter). Use these values to initialise default app.
Maintain existing behaviour; If name & FirebaseOptions are passed in, use these values to create additional app.

Untouched legacy plugins that internally initialise default app:

firebase_dynamic_links
firebase_in_app_messaging
firebase_ml_vision (also deprecated)

Untouched deprecated plugins:

firebase_admob

Untouched packages as they don't initializeApp() in example:

firebase_performance
firebase_ml_custom

Problem packages

firebase_crashlytics. iOS requires this run script for your app to function. Your app will fail to build when using the run script (will also fail without) which fails with this error now we've removed GoogleServices.plist:

It appears this upload-symbols script is looking for GoogleServices.plist property GOOGLE_APP_ID (We pass this in dart code now via this property FirebaseOptions.appId). This will probably require an intervention from Firebase Crashlytics team.
Additional config

firebase_auth. Using verifyPhoneNumber() API does require an update to the user's ios/Runner/Info.plist, specifically adding the reverse client id as described in the documentation here. Also need to pass in iosClientId in the FirebaseOptions (see this commit).

Related Issues
none.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.

[ ] I read the Contributor Guide and followed the process outlined there for submitting PRs.
[ ] My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
[ ] All existing and new tests are passing.
[ ] I updated/added relevant documentation (doc comments with ///).
[ ] The analyzer (melos run analyze) does not report any problems on my PR.
[ ] I read and followed the Flutter Style Guide.
[ ] I signed the CLA.
[ ] I am willing to follow-up on review comments in a timely manner.

Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?

[ ] Yes, this is a breaking change.
[ ] No, this is not a breaking change.

@eleojasmil Yes it is, we're currently blocked on a Firebase side issue on Crashlytics.

@googlebot I consent.

@googlebot I consent.


Http Server

Added a dockerfile which exposed the model via rest api.
flask server will run on port 5005
URL - POST /query/{model} - model can be aesthetics or technical
Parameters - [
"<image_url_1>",
"<image_url_2>"
]
Response -
[
    {
        "image_id": "<image_name_1>",
        "mean_score_prediction": 4.780154329499055
    },
    {
        "image_id": "<image_name_2>",
        "mean_score_prediction": 4.780154329499055
    }
]

Hi, thanks a lot for the PR! It's a great idea to add a Flask server to the repo - there are a few things that need to be addressed in your PR:

Every time a request is send to an endpoint the respective model needs to be loaded which is inefficient. I would suggest to have only one prediction endpoint, in which the model only gets loaded once. You can achieve this e.g. with

def load_model(config):
    global model
    model = Nima(config['base_model_name'])
    model.build()
    model.nima_model.load_weights(config['weights_file'])
    model.nima_model._make_predict_function()  # https://github.com/keras-team/keras/issues/6462
    model.nima_model.summary()

...

if __name__ == '__main__':
    load_model(config)

    app.run(host='<IP_ADDRESS>', port=PORT)

The model should be provided as an argument when starting the Flask server. This has the downside that not both models are available in the same server, but makes it a lot more flexible for other users to serve their own models.

There are a lot of unneeded imports in src.server.py

Please add a description in the README of how to build the docker image and serve predictions

Many thanks!

Hi, thanks for considering it! Please have a look at the server.py changes and let me know if anything else needs to be done!

Up :D

It needed a few more bug fixes, but I'm using this now as well. Sorry not to push the fixes but I needed some personal customisations too. Anyway, thanks. Hope this gets merged soon!

Hi guys, thank you for the great work and sharing it !
Is there an exec file to make the Flask server run ?


Angular produces incorrect transpiled code using typescript 5.0.4 but correct one using 4.9.x

Which @angular/* package(s) are the source of the bug?
compiler-cli, compiler, core
Is this a regression?
No
Description
Hi! I'm updating to Angular 16 and I've found a significally difference with the resulted compiled code between typescript 4.9.4 and 5.0.4
Here is an example of the problematic code:
export class IssueService {
  #throwIfUndefined = this.assertIfPropertyIsDefined();

  constructor(private readonly property) {}

  assertIfPropertyIsDefined() {
    if (!this.property) {
      throw new Error('the property should be defined');
    }
  }
}

Using Typescript 4.9.4 the service is transpiled to:
    __webpack_require__.r(__webpack_exports__);
        /* harmony export */
        __webpack_require__.d(__webpack_exports__, {
            /* harmony export */
            "IssueService": ()=>(/* binding */
            IssueService)/* harmony export */
        });
        /* harmony import */
        var _xxx_node_modules_babel_runtime_helpers_esm_classPrivateFieldInitSpec_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*<EMAIL_ADDRESS>*/
        4482);
        /* harmony import */
        var _xxx_node_modules_babel_runtime_helpers_esm_classPrivateFieldSet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*<EMAIL_ADDRESS>*/
        692);

        var _throwIfUndefined = /*#__PURE__*/
        new WeakMap();
        class IssueService {
            // Get attention to these lines
            constructor(property) {
                (0,
                _xxx_node_modules_babel_runtime_helpers_esm_classPrivateFieldInitSpec_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, _throwIfUndefined, {
                    writable: true,
                    value: void 0
                });
                this.property = property;
                (0,
                _xxx_node_modules_babel_runtime_helpers_esm_classPrivateFieldSet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, _throwIfUndefined, this.assertIfPropertyIsDefined());
            }
            assertIfPropertyIsDefined() {
                if (!this.property) {
                    throw new Error('the property should be defined');
                }
            }
        }

But using Typescript 5.0.4 the service is transpiled to:

        __webpack_require__.r(__webpack_exports__);
        /* harmony export */
        __webpack_require__.d(__webpack_exports__, {
            /* harmony export */
            "IssueService": ()=>(/* binding */
            IssueService)/* harmony export */
        });
        /* harmony import */
        var xxx_node_modules_babel_runtime_helpers_esm_classPrivateFieldInitSpec_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*<EMAIL_ADDRESS>*/
        4482);

        var _throwIfUndefined = /*#__PURE__*/
        new WeakMap();
        class IssueService {
            constructor(property) {
                // The code is different and this code produces an exception where using 4.9.4 don't
                (0,
                _xxx_node_modules_babel_runtime_helpers_esm_classPrivateFieldInitSpec_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, _throwIfUndefined, {
                    writable: true,
                    value: this.assertIfPropertyIsDefined()
                });
                this.property = property;
            }
            assertIfPropertyIsDefined() {
                if (!this.property) {
                    throw new Error('the property should be defined');
                }
            }
        }

As you can see, the difference comes from the initialization of private fields. Well, I can't reproduce it on typescript side
Maybe it's a babel issue, but I don't know how to check it and I haven't found any issue about it...
I've prepared a minimal reproduction:

this commit works: https://github.com/tonivj5/angular-ts-5-transpilation-issue/commit/8b995e3ce123273cb6cde8a778964a61f5939d51 (ts 4.9.4, good transpilation)
this commit doesn't work: https://github.com/tonivj5/angular-ts-5-transpilation-issue/commit/6cd80130b998ecf39c58d3a6698108e7de77798b (ts 5.0.4, bad transpilation)

Please provide a link to a minimal reproduction of the bug
https://github.com/tonivj5/angular-ts-5-transpilation-issue
Please provide the exception or error you saw
Ucaught Error: the property should be defined
    at IssueService.assertIfPropertyIsDefined (issue.service.ts:8:13)
    at new IssueService (issue.service.ts:2:28)
    at 6747 (app.module.ts:13:17)
    at __webpack_require__ (bootstrap:19:1)
    at 4431 (issue.service.ts:10:3)
    at __webpack_require__ (bootstrap:19:1)
    at __webpack_exec__ (main.ts:7:36)
    at main.ts:7:36
    at __webpack_require__.O (chunk loaded:23:1)
    at main.ts:7:36
a

Please provide the environment you discovered this bug in (run ng version)
Node.js version v19.4.0 detected.
Odd numbered Node.js versions will not enter LTS status and should not be used for production. For more information, please see https://nodejs.org/en/about/releases/.

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/

Angular CLI: 16.0.0
Node: 19.4.0 (Unsupported)
Package Manager: npm 9.2.0
OS: linux x64

Angular: 16.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1600.0
@angular-devkit/build-angular   16.0.0
@angular-devkit/core            16.0.0
@angular-devkit/schematics      16.0.0
@schematics/angular             16.0.0
rxjs                            7.8.1
typescript                      5.0.4

Warning: The current version of Node (19.4.0) is not supported by Angular.

Anything else?
No response

Hi again! @alan-agius4 I have updated the repro to the latest version (16.0.1) and the error persists 😿
Commit updating to latest: https://github.com/tonivj5/angular-ts-5-transpilation-issue/commit/8bd058466c90350e80b602ab26d9fa2665fe05ef

Looks like there is a TypeScript bug when using ECMA private fields.
See: https://github.com/microsoft/TypeScript/issues/54206


Verify unique order transaction on ETH wallet

Need to validate when ETH transactions to any given OB wallet needs to be appropriately associated with the right Order. Since all ETH txs are to the same Address, there needs to be another mechanism for identifying the intended Order to pay for.
Discussed putting this information as metadata for the transaction.
Note: Need to understand what this UX flow looks like for external wallets destined for OB order payment.
Tasks:

[ ] ChainCode deserialization example (@cpacia)
[ ] PR supporting transaction callback change (@amangale)

Discussed deserializing the ChainCode out from ExtendedKey response. And adding the orderId to transaction callback.

We've created a path forward with this


Feature Request: Swift Package Manager Precompiled Binaries

Goals
We are in the process of adopting SPM as our primary package manager. Given that it now supports binary artefacts, is there any chance that Realm can be distributed as a precompiled binary?
Compiling Realm is a good chunk of our clean build, and having precompiled binaries would probably speed things up for many developers using Realm and SPM.
Version of Realm and Tooling
Xcode version: 12+
iOS/OSX version: 11+

As of XCode 12.2 beta 3, SPM's binary artifact support doesn't actually work. You can build an application which depends on a prebuilt framework, but Archiving the application fails to set the search paths correctly and that step fails. I filed FB8706513 for this.
Once it actually works there still isn't a great way to let people pick at install time whether they want to use a binary or build from source, and there's some significant advantages to building from source.

Very good points!
Maybe this can be revisited once the dust settles around SPM binary artefacts.
Thanks for your answer!

@tgoyne Any chance this has been improved by SPM in Xcode 12.3? We would also like to move our packages to SPM and away from cocoapods but the clean build time here is a major drawback.
Can this issue be re-opened for tracking when Apple addresses the issue/radar?

If Apple does ever fix it I think it'd make sense to look into what we can offer. I think we actually could package just the obj-c xcframework in a spm-compatible format, which would eliminate the vast majority of the build time (at the cost of being a nontrivial download size).

@tgoyne that would be great if do-able! Could the realm-core xcframework that the pod script is already using be used for this?

No, that's the thing that's broken. For various reasons we need the core library to be a static library when it's linked into the obj-c library, and consuming a static xcframework via spm makes it so that you can't archive the app. Consuming a dynamic xcframework also was broken in 12.0 but has now been fixed, so we could potentially ship a pre-build obj-c dynamic framework and only build the swift part from source.

@tgoyne interesting. Thanks for the explanation. Would an xcframework for the objc library make clean builds from SPM faster than one from cocoapods?

Can it be reopened and fixed? 🙃

We are looking into this now.

What is the current status of this? Would be great to have precompiled binaries in SPM.

I actually managed to get this working by downloading the release files, extracting the .xcframework files, individually compressing them separately, as you need the Realm.xcframework and the RealmSwift.xcframework as separate ZIP files, uploading them to my own cloud storage and declaring the as the following in the Package.swift:
    targets: [
        .binaryTarget(name: "Realm",
                      url: "https://my-cloud-storage/frameworks/Realm/10.11.0.zip",
                      checksum: "ededbea676d0acfd8136c40c22e733a1ed9a623a049c40782057789a474d2fb9"),
        .binaryTarget(name: "RealmSwift",
                      url: "https://my-cloud-storage/frameworks/RealmSwift/10.11.0.zip",
                      checksum: "b022fa4d881400249ee50348bf08d1e8625dc748ab5355f73b41e129566b4ad9")
    ]

I guess if the Realm team could additionally upload the Realm.xcframework and the RealmSwift.xcframework as own ZIP files in the releases, we could directly set the GitHub URL in the Package.swift manifest

While Realm team is sorting this out, I created a repo based on @philprime idea : https://github.com/bioche/RealmBinaries
It stores xcframeworks in the release note for XCode 12.5.1 & XCode 13.0. You just have to reference RealmBinaries in the Package.swift like so (the tags will match Realm tags) :
.package(name: "RealmBinaries", url: "https://github.com/bioche/RealmBinaries", .upToNextMajor(from: "10.0.0"))

I can confirm @bioche's repo works like a charm. 👍 Looking forward for the integration in the official releases. :-)

Uh, just noticed in the release notes of v10.18.0:
- Add prebuilt binary for Xcode 13.1 to the release package.
In the latest release notes (v10.20.2), the prebuilt binary is mentioned, too:
Rebuild 10.20.1 with Xcode 13.2.1 rather than 13.2.0. This version has no
changes if you are not using a prebuilt binary for Realm.

Mh.... Xcode is still compiling Realm when using SPM.

We have prebuilt xcframeworks available on each of the releases, which the spm package does not use.

@tgoyne even tough the xcframework you provide work fine,  the asset archive structure is not suitable for SPM.
You are providing a single realm-swift-X.Y.Z.zip archive which contains the compiled .xcframework for each Xcode version (and the respective Swift version) combined..
The file tree looks like the following:
realm-swift-10.20.2.zip
├── 12.4
│   ├── Realm.xcframework
│   └── RealmSwift.xcframework
├── 12.5.1
│   ├── Realm.xcframework
│   └── RealmSwift.xcframework
├── 13.0
│   ├── Realm.xcframework
│   └── RealmSwift.xcframework
├── 13.1
│   ├── Realm.xcframework
│   └── RealmSwift.xcframework
└── 13.2.1
    ├── Realm.xcframework
    └── RealmSwift.xcframework

But to be able to use precompiled frameworks with SPM, the respective  .xcframework needs to be the top-level object of the archive. Furthermore the top-level object must be the exact name of the framework, as Xcode tries to copy the Realm.xcframework file from the archive which contains the Realm SPM package.
Therefore you need to publish them in individual release assets.
Example Archive Format:
realm-<variant>__<framework>__<version>__<Xcode>.xcframework.zip
Options:

variant: objc or swift
framework: Realm or RealmSwift
version: usual semantic versioning
Xcode: the Xcode version 12.4, 13.1 etc.

Something like the following tree for each release:
realm-swift__Realm__10.20.2__12.4.zip
└── Realm.xcframework
realm-swift__RealmSwift__10.20.2__12.4.zip
└── RealmSwift.xcframework
realm-swift__Realm__10.20.2__13.1.zip
└── Realm.xcframework
realm-swift__RealmSwift__10.20.2__13.1.zip
└── RealmSwift.xcframework
...

@bioche did exactly that (but only for the swift variant, without the version number and only the latest two Xcode versions)--> https://github.com/bioche/RealmBinaries/releases/tag/10.20.1
Of course this leads to more assets in the GitHub release artifacts, but this way it is possible to directly access a specific framework archive from SPM

I cannot explain how painful it is to compile Realm in low resource situations like cloud CI. If it's not a binary it takes like 30 minutes to compile. Not to mention weird quirks that carthage & rome have.
Please give us something that SPM can consume directly.

I have found a hack to use CocoaPods with Carthage.xframework provided by realm:

Add Realm.podspec to your repository

Pod::Spec.new do |spec|
    spec.name         = 'Realm'
    spec.version      = '10.25.1'
    spec.license      = '-'
    spec.homepage     = '-'
    spec.authors      = '-'
    spec.summary      = '-'
    spec.source       = { :http => 'https://github.com/realm/realm-swift/releases/download/v10.25.1/Carthage.xcframework.zip' }
    spec.vendored_frameworks = ['Realm.xcframework', 'RealmSwift.xcframework']
end

Add a pod to Podfile

pod 'Realm', :podspec => 'Realm.podspec'

I still wonder why this problem does not cause more outcry.

I still wonder why this issue does not cause more outcry.

Probably because carthage exists. Our project continues to use carthage mainly due to this issue.Do we want to move off carthage? Yes!

@leemaguire commented on 19 May 2021:
We are looking into this now.

Any update for us?

Come on. Why is this still an open issue?

Made a repo which helps to solve this problem :)
https://github.com/RomanEsin/RealmBinary

Starting with the next release we'll be automatically publishing SPM-compatible zips to our github releases. We still need to add an official repo which consumes those binaries via a wrapper package.

TLDR; I tried SPM compatible xcframework zips, and it worked, but rejected by App Store.
After the release v10.42.0, which offers SPM compatible xcframework zips, I created a local Package.swift file and applied to my application.

Package.swift
// swift-tools-version:5.8

import PackageDescription

func buildTargets() -> [Target] {
  let baseURL = "https://github.com/realm/realm-swift/releases/download/v10.42.0"
  let realmChecksum = "7f9a35c79761daa3384c3d8bdc830092c086efc61922befda8fe24c6e78c3d1c"

  #if swift(>=5.9)
    let xcodeVersion = "15.0"
    let realmSwiftChecksum = "c115d1ee1a375d4904f48d4e0884bccc3148c53e159a34c9a4a44499d1d44475"
  #else
    let xcodeVersion = "14.3.1"
    let realmSwiftChecksum = "f31d284e334b98005d9c30a14eb967c042f6e7de963949284c1a38f3f4c83fe1"
  #endif

  return [
    .binaryTarget(
      name: "Realm",
      url: "\(baseURL)/Realm.xcframework.zip",
      checksum: realmChecksum
    ),
    .binaryTarget(
      name: "RealmSwift",
      url: "\(baseURL)/RealmSwift@\(xcodeVersion).xcframework.zip",
      checksum: realmSwiftChecksum
    ),
  ]
}

let package = Package(
  name: "RealmSPM",
  platforms: [
    .macOS(.v10_13),
    .iOS(.v11),
    .tvOS(.v11),
    .watchOS(.v4),
  ],
  products: [
    .library(
      name: "Realm",
      targets: ["Realm"]
    ),
    .library(
      name: "RealmSwift",
      targets: ["Realm", "RealmSwift"]
    ),
  ],
  targets: buildTargets()
)

My app was built and worked nicely on simulators and real devices, but it was rejected by App Store Connect due to the following reasons.
I'm using tuist and Xcode 14.3.1.

Rejected by apple because the app uses non-public API & invalid sdk value
ITMS-90338: Non-public API usage - The app references non-public symbols in Frameworks/Realm.framework/Realm: __availability_version_check. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/
ITMS-90512: Invalid sdk value - The value provided for the sdk portion of LC_BUILD_VERSION in (Redacted).app/Frameworks/Realm.framework/Realm is 17.0 which is greater than the maximum allowed value of 16.6.

It looks like that "Realm.xcframework" is built with Xcode 15.0 beta, so App Store denied the binary.
I don't know why __availability_version_check is used.

Only the visionOS libraries are supposed to be built with Xcode 15, but maybe the xcframework is getting assembled incorrectly. I'll take a look.

Update on an SPM repo wrapping these binary targets?


5xx: Server Error

Sometimes it logs in, sometimes it doesn't load at all. Very slow when logged in and then error screen appears. Has been happening the last couple of days, seems to be worse today. Constant errors below.

The same.


Long delay when starting camera

When starting camera to attach photo, there's about 10-15 seconds delay with green circle spinning before I'm able to actually take picture.  Is it possible to reduce this? Thanks.

Hello @mehturt ,
Are you using the native camera? You can check this is the Riot's settings, in the Labs section.
Benoît

Hi @bmarty ,
I'm using whatever the default is.
Checking now I guess I'm not using the native camera.
When switching to native camera, there's no delay.  Actually, when switching back (to not use native camera), it's fast as well.

Mhhh.. So it seems this issue is fixed for you...

Yes, I was checking this in the past few days, and it's OK now even with non-native camera.  So I guess the issue can be closed now.


Expand SERIAL documentation

Excerpts from Gitter:
Adam @apinckard 09:39
Hi all. Quick question is the SERIAL data type guaranteed to be monotonically increasing as well as globally unique? (understand that is not always sequential)
... So we are intending to use it for very high frequency. If two transactions occur concurrently can we guarantee monotonically increasing e.g. first to commit < second to commit?
kena @knz 09:50
right now the SERIAL values are based off the current time up to microsecond precision. You always get different values on different nodes, but if you have 2 concurrent transactions on the same node asking for SERIAL values at the same time, one could get a value and another the same value or just below (or above) it with no guarantee on ordering.
no the ordering is not related to commit order.
...
the nearest we have to what you want/need is another function called cluster_logical_timestamp() which returns a DECIMAL value. It's heavier than a simple int
Adam @apinckard 09:56
...
One follow up: within a single transaction is the output of serial guaranteed to be monotonically increasing?
kena @knz 10:43
within a single transaction, the output of serial is currently guaranteed to be monotonically increasing as long as your system clock does not jump backwards
if it does (which seems to happen in cloud servers, where VMs are migrated live), all bets are off
feel free to summarize the current situation and what you'd like to see instead in our github issue tracker.

If two transactions occur concurrently can we guarantee monotonically increasing e.g. first to commit < second to commit.

The short answer is no. This is very expensive to guarantee. MySQL AUTO_INCREMENT and Postgres SERIAL and sequences do not provide this guarantee either. I believe I've provided simple examples demonstrating this before.

@petermattis yes you have so that's why this doc issue now exists so we can propagate your examples to the docs :)

In the SERIAL docs, we have an example of how the SERIAL type in PostgreSQL and CockroachDB, and the AUTO_INCREMENT type in MySQL, all behave the same in that they do not create strict sequences. But I don't think that example covers the above. Can someone either point me to the examples @petermattis has provided before or add them here?

Scenario 1:

at time 3 txn T1 BEGINs
at time 4 txn T2 BEGINs on the same node (from a different client)
at time 5 txn T1 creates a SERIAL value, x
at time 5 + 2 microseconds txn T2 creates a SERIAL value, y
at time 6 txn T1 COMMITs
at time 7 txn T2 COMMITs

If this happens we cannot guarantee whether x < y or x > y, despite the fact T1 and T2 began / committed in different times. In this particular example it's even likely that x = y because there is less than a 10-microsecond difference and the SERIAL values are constructed from the number of microseconds in the current time.
Scenario 2:

at time 3 txn T1 BEGINs
at time 3 txn T2 BEGINs somewhere else, on a different node
at time 5 txn T1 creates a SERIAL value, x
at time 6 txn T2 creates a SERIAL value, y
at time 8 txn T1 COMMITs
at time 8 txn T2 COMMITs

If this happens we cannot guarantee whether x < y or x > y. Both can happen, even though the transactions began and committed at the same time. However it's sure that x != y because the values were generated on different nodes.
Scenario 3:

at time 3 txn T1 BEGINs
at time 4 txn T1 creates a SERIAL value, x
a time 5 txn T1 COMMITs
at time 6 txn T2 BEGINs somewhere else, on a different node
at time 7 txn T2 creates a SERIAL value, y
at time 8 txn T2 COMMITs
there is less than 250ms difference between the system clocks of the two nodes.

If this happens we cannot again guarantee whether x < y or x > y. Even though the transactions "clearly" occurred one "after" the other, perhaps there was a clock skew between the two nodes and the system time of the 2nd node is set earlier than the 1st node.
The latter scenario is arguably particularly jarring. People may be OK with a SERIAL type that is not strictly sequential, but they are likely not OK with a type that is not monotonic.
FWIW @petermattis has a TODO in the code (https://github.com/cockroachdb/cockroach/blob/97fdeca9bd63ed906849805199efcc03a4a8fcd3/sql/parser/builtins.go#L1509-L1511) to look into this. My personal opinion is that we should change that code to at least use the cluster logical time instead of the system time, so that we restore monotonicity. Peter what do you think?


👷 fix workflow

Current dependencies on/for this PR:

main

PR #67   👈

This stack of pull requests is managed by Graphite.