Failover Delay

Hi,
I am running eap_proxy on my USG 4P. The ONT is on eth2 & the gateway is on eth1. I also have a LTE Modem on WAN2 (eth 3).
If I unplug the ONT connection from the USG it failover to WAN2 but once I connect the ONT back onto the USG it doesn't fail back to WAN1/eth2.
Feb 13 23:27:46 Router zebra[641]: interface eth2 index 4 changed <UP,BROADCAST,MULTICAST>.
Feb 13 23:27:46 Router zebra[641]: interface eth2.0 index 15 changed <UP,BROADCAST,MULTICAST>.
Feb 13 23:27:46 Router kernel: eth2: Link down
Feb 13 23:27:50 Router wlb: wlb-wan_failover-eth2.0 wlb-wan_failover-eth2.0 reachability failed, failover
Feb 13 23:27:50 Router wlb: group wan_failover, interface eth2.0 going Inactive
Feb 13 23:27:50 Router wlb: group wan_failover, interface eth3 going Active
Feb 13 23:27:50 Router wan-event: [WAN Transition] eth2.0 to state inactive
Feb 13 23:27:50 Router wan-event: [WAN Transition] eth3 to state active
Feb 13 23:29:03 Router zebra[641]: interface eth2 index 4 changed <UP,BROADCAST,RUNNING,MULTICAST>.
Feb 13 23:29:03 Router zebra[641]: interface eth2.0 index 15 changed <UP,BROADCAST,RUNNING,MULTICAST>.
Feb 13 23:29:03 Router kernel: eth2: 1000 Mbps Full duplex, port 2
Feb 13 23:29:34 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 1, len 15 [11] > eth1
Feb 13 23:30:04 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 1, len 15 [11] > eth1
Feb 13 23:30:34 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 1, len 4 [0] > eth1
Feb 13 23:30:34 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 2, len 15 [11] > eth1
Feb 13 23:31:35  eap_proxy[3912]: last message repeated 2 times
Feb 13 23:32:05 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 2, len 4 [0] > eth1
Feb 13 23:32:05 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 3, len 15 [11] > eth1
Feb 13 23:33:06  eap_proxy[3912]: last message repeated 2 times
Feb 13 23:33:36 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 3, len 4 [0] > eth1
Feb 13 23:33:36 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 4, len 15 [11] > eth1
Feb 13 23:34:37  eap_proxy[3912]: last message repeated 2 times
Feb 13 23:35:07 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 4, len 4 [0] > eth1
Feb 13 23:35:07 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 5, len 15 [11] > eth1
Feb 13 23:36:08  eap_proxy[3912]: last message repeated 2 times
Feb 13 23:36:38 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 5, len 4 [0] > eth1
Feb 13 23:36:38 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 6, len 15 [11] > eth1
Feb 13 23:37:46  eap_proxy[3912]: last message repeated 2 times
Feb 13 23:38:09 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 6, len 4 [0] > eth1
Feb 13 23:38:09 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 7, len 15 [11] > eth1
Feb 13 23:38:14 Router sshd[10054]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=<IP_ADDRESS>  user=Siddiqi
Feb 13 23:38:39 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 7, len 15 [11] > eth1
Feb 13 23:39:09 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 7, len 15 [11] > eth1
Feb 13 23:39:40 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 7, len 4 [0] > eth1
Feb 13 23:39:40 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 8, len 15 [11] > eth1
Feb 13 23:40:47  eap_proxy[3912]: last message repeated 2 times
Feb 13 23:41:11 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 8, len 4 [0] > eth1
Feb 13 23:41:11 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 9, len 15 [11] > eth1
Feb 13 23:42:17  eap_proxy[3912]: last message repeated 2 times
Feb 13 23:42:41 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 9, len 4 [0] > eth1
Feb 13 23:42:41 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 10, len 15 [11] > eth1
Feb 13 23:43:42  eap_proxy[3912]: last message repeated 2 times
Feb 13 23:44:12 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 10, len 4 [0] > eth1
Feb 13 23:44:12 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 11, len 15 [11] > eth1
Feb 13 23:45:13  eap_proxy[3912]: last message repeated 2 times
Feb 13 23:45:43 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 11, len 4 [0] > eth1
Feb 13 23:45:43 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 12, len 15 [11] > eth1
Feb 13 23:46:44  eap_proxy[3912]: last message repeated 2 times
Feb 13 23:47:14 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 12, len 4 [0] > eth1
Feb 13 23:47:14 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 13, len 15 [11] > eth1
Feb 13 23:48:15  eap_proxy[3912]: last message repeated 2 times
Feb 13 23:48:45 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 13, len 4 [0] > eth1
Feb 13 23:48:45 Router eap_proxy[3912]: eth2: 00:90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 14, len 15 [11] > eth1
Feb 13 23:49:46  eap_proxy[3912]: last message repeated 2 times
Feb 13 23:49:52 Router sshd[12569]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=<IP_ADDRESS>  user=Siddiqi

UPDATE - So it finally reverted back to the ONT but it took ~30 minutes.
Feb 14 00:05:25 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 24, len 4 [0] > eth1
Feb 14 00:05:25 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 25, len 15 [11] > eth1
Feb 14 00:06:26  eap_proxy[3912]: last message repeated 2 times
Feb 14 00:06:56 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Failure (4) id 25, len 4 [0] > eth1
Feb 14 00:06:56 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 26, len 15 [11] > eth1
Feb 14 00:07:09 Router ipsec-dhclient-hook: DHCP address updated to from xxx.x.xxx.xx: Updating ipsec configuration.
Feb 14 00:07:10 Router ipsec-dhclient-hook: DHCP address updated to from xxx.x.xxx.xx: Updating ipsec configuration.
Feb 14 00:07:10 Router xl2tpd[4808]: death_handler: Fatal signal 15 received
Feb 14 00:07:10 Router xl2tpd[15489]: parse_config: line 3: set_ip: host '' not found
Feb 14 00:07:10 Router xl2tpd[15489]: init: Unable to load config file
Feb 14 00:07:26 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 15, Request (1) id 26, len 15 [11] > eth1
Feb 14 00:07:26 Router eap_proxy[3912]: eth1: 90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v2, len 22, Response (2) id 26, len 22 [18] > eth2
Feb 14 00:07:26 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 90:xx:xx:xx:xx, EAP packet (0) v1, len 6, Request (1) id 27, len 6 [2] > eth1
Feb 14 00:07:27 Router eap_proxy[3912]: eth1: 90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v2, len 92, Response (2) id 27, len 92 [88] > eth2
Feb 14 00:07:27 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 90:xx:xx:xx:xx, EAP packet (0) v1, len 1020, Request (1) id 28, len 1020 [1016] > eth1
Feb 14 00:07:27 Router eap_proxy[3912]: eth1: 90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v2, len 6, Response (2) id 28, len 6 [2] > eth2
Feb 14 00:07:27 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 90:xx:xx:xx:xx, EAP packet (0) v1, len 1020, Request (1) id 29, len 1020 [1016] > eth1
Feb 14 00:07:27 Router eap_proxy[3912]: eth1: 90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v2, len 6, Response (2) id 29, len 6 [2] > eth2
Feb 14 00:07:27 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 90:xx:xx:xx:xx, EAP packet (0) v1, len 1020, Request (1) id 30, len 1020 [1016] > eth1
Feb 14 00:07:27 Router eap_proxy[3912]: eth1: 90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v2, len 6, Response (2) id 30, len 6 [2] > eth2
Feb 14 00:07:27 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 90:xx:xx:xx:xx, EAP packet (0) v1, len 193, Request (1) id 31, len 193 [189] > eth1
Feb 14 00:07:28 Router eap_proxy[3912]: eth1: 90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v2, len 906, Response (2) id 31, len 906 [902] > eth2
Feb 14 00:07:28 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 90:xx:xx:xx:xx, EAP packet (0) v1, len 6, Request (1) id 32, len 6 [2] > eth1
Feb 14 00:07:28 Router eap_proxy[3912]: eth1: 90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v2, len 902, Response (2) id 32, len 902 [898] > eth2
Feb 14 00:07:28 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 90:xx:xx:xx:xx, EAP packet (0) v1, len 6, Request (1) id 33, len 6 [2] > eth1
Feb 14 00:07:28 Router eap_proxy[3912]: eth1: 90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v2, len 902, Response (2) id 33, len 902 [898] > eth2
Feb 14 00:07:28 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 90:xx:xx:xx:xx, EAP packet (0) v1, len 6, Request (1) id 34, len 6 [2] > eth1
Feb 14 00:07:29 Router eap_proxy[3912]: eth1: 90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v2, len 485, Response (2) id 34, len 485 [481] > eth2
Feb 14 00:07:29 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 90:xx:xx:xx:xx, EAP packet (0) v1, len 69, Request (1) id 35, len 69 [65] > eth1
Feb 14 00:07:29 Router eap_proxy[3912]: eth1: 90:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v2, len 6, Response (2) id 35, len 6 [2] > eth2
Feb 14 00:07:29 Router eap_proxy[3912]: eth2.0: restarting dhclient
Feb 14 00:07:30 Router ipsec-dhclient-hook: DHCP address updated to from xxx.x.xxx.xx: Updating ipsec configuration.
Feb 14 00:07:30 Router ipsec-dhclient-hook: DHCP address updated to from xxx.x.xxx.xx: Updating ipsec configuration.
Feb 14 00:07:30 Router xl2tpd[15630]: parse_config: line 3: set_ip: host '' not found
Feb 14 00:07:30 Router xl2tpd[15630]: init: Unable to load config file
Feb 14 00:07:31 Router eap_proxy[3912]: eth2: 00:xx:xx:xx:xx > 01:80:xx:xx:xx:xx, EAP packet (0) v1, len 4, Success (3) id 35, len 4 [0] > eth1
Feb 14 00:07:33 Router ipsec-dhclient-hook: DHCP address updated to xxx.x.xxx.xx from xxx.x.xxx.xx: Updating ipsec configuration.
Feb 14 00:07:33 Router ipsec-dhclient-hook: DHCP address updated to xxx.x.xxx.xx from xxx.x.xxx.xx: Updating ipsec configuration.
Feb 14 00:07:33 Router xl2tpd[15756]: setsockopt recvref[30]: Protocol not available
Feb 14 00:09:01 Router wlb: group wan_failover, interface eth2.0 going Active
Feb 14 00:09:01 Router wan-event: [WAN Transition] eth2.0 to state active
Feb 14 00:09:01 Router wan-event: [WAN Transition] eth3 to state failover
Feb 14 00:09:31 Router kernel: [WAN_IN-3003-A]IN=eth2.0 OUT=eth0 MAC=90:xx:xx:xx:xx:00:03:fa:6a:45:21:08:00:45:00:00:3c SRC=34.xxx.xxx.xx DST=<IP_ADDRESS> LEN=60 TOS=0x00 PREC=0x00 TTL=33 ID=24432 DF PROTO=TCP SPT=37340 DPT=32400 WINDOW=7300 RES=0x00 SYN URGP=0 MARK=0x64800000

If I were to reboot the USG, it would just take a few seconds.

Unfortunately it doesn't seem like there's much eap_proxy can do here. From the logs, the proxy is forwarding the auth packets from the ONT to the RG, but the RG isn't responding. I think what's going on here is that the RG, after not being able to get online for some period of time, goes into a state where it stops responding to the ONT. At some point the RG appears to reset itself at which point is responds as expected.
Perhaps resetting the interface the RG is on could get it to respond again. Another possibility is forwarding more traffic than just the auth packets between the ONT and RG to fool the RG into thinking it's online. I'm not sure really, and don't currently have any time to look into it.

FWIW, even without the proxy in place, when I've had my ONT go down and the come back due to line issues, I've had to reset my RG to get it back online.

So rebooting the RG would do the trick?

To add to this, I have the same setup with a cellular backup on WAN2. (My only difference is my WAN1 is on the SFP port)
I noticed that on bootup, the IP the USGP4 pulled on the WAN1 network is actually from my LTE Modem, which is on WAN2. So far, unplugging the LTE modem from WAN2, then plugging it in after the WAN1 is up and active has been ok.
I'm also having issue with the eap_proxy script running on reboot, so there may be correlation.

I looked back and realized I left the --vlan-id 2 out of my eap_proxy.sh (was only using it in the terminal command to check initially) after updating that the script does load as expected on reboot.
It now works as expected with both WAN1 and WAN2 connected on reboot (proper IPs on each interface).  I'll test mimicking a failover event when I get a chance and see if my experience is the same as @K-MTG
Thanks for all your work on this @jaysoffian !


Duplicate log messages

Every log message (except event logs) is logged 2 times, once in the custom format set in the "superset_config.py" (or the default one in "config.py" if not set otherwise) and the second time just the message without any context.
How to reproduce the bug

Run apache/superset image locally with docker
Look at logs

Expected results
See every log entry once
Actual results
See every log entry twice
Logs from docker logs
logging was configured successfully
2022-09-29 12:14:17,528:INFO:superset.utils.logging_configurator:logging was configured successfully

From what I managed to find out, superset logs itself but somehow the messages are propagated up to gunicorn, which itself logs everything again. My knowledge about python is very limited, so I could not locate the root of the problem, however I found a workaround.
I disabled all logging for superset by adding the following to the conifg.py:
class NoLoggingConfigurator(  # pylint: disable=too-few-public-methods
    LoggingConfigurator
):
    def configure_logging(
        self, app_config, debug_mode
    ) -> None:
        logger.info("logging was configured successfully")

# disable logging for superset; logs are handled by gunicorn
LOGGING_CONFIGURATOR = NoLoggingConfigurator()

Furthermore, I added those 2 files to the root dir of superset:

gunicorn_logging.conf from stackoverflow
jsonlogging.py from github

Now add --log-config gunicorn_logging.conf to the gunicorn command when starting superset and there will be only the json loggs from gunicorn. I am also setting the env variable PYTHONWARNINGS=ignore to prevent any (non-json) warnings from showing up.

I still believe that logging should work properly without such a workaround, especially if it explicitly recommanded in the docs to use gunicorn.

Is this still an issue in 3.x? I feel like I remember there were some improvements made in this area. Tempted to close as stale/obsolete since we don't support 2.x anymore.

still a problem in 4.0.0 but seems like @jessie-ross is already on it in #27777


Nordic Layout Json File

So i spent some time with this and i have a json file that contains all the right mapping for nordic layouts, but our KeyCodes are a tad different from some of the layouts, so when i type on some buttons it will not corespond correctly on where it is mapped, so i included the right KeyCode inside the json file and if you could implement it to the project that would be awsome.
layout.nord.txt
its converted to a txt file so i could upload it dirrectly to here.

saw that pull request #525 had all of the things for the nordic layout


Consider to remove TRANSITION_TARGETS

instead change BaseOrder.get_transition_name(target) to accept the transition function.
Decorate each transition function with a verbose name.

This does not work. Sometimes there is more than one transition pointing to the same target. This would lead to confusion.


add point type

Summary
Add support for Point type.
Closes https://github.com/ClickHouse/clickhouse-connect/issues/151
Checklist
Delete items not relevant to your PR:

[x] Unit and integration tests covering the common scenarios were added
[x] A human-readable description of the changes was provided to include in CHANGELOG

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

Thanks for the PR!
I'm a little concerned about the implementation of converting Point to a Tuple(Float64, Float64).  It looks like ClickHouse actually sends Point as the type:
CREATE TABLE points
(
    `key` UInt32,
    `value` Point
)
ENGINE = MergeTree
ORDER BY key

INSERT INTO points VALUES(1, (5.22, 7.83));

clickhouse client --port 9007 --query "SELECT * from points FORMAT Native" | xxd

00000000: 0201 036b 6579 0655 496e 7433 3201 0000  ...key.UInt32...
00000010: 0005 7661 6c75 6505 506f 696e 74e1 7a14  ..value.Point.z.
00000020: ae47 e114 4052 b81e 85eb 511f 40<EMAIL_ADDRESS>
It seems we should be consistent and use the Point name when doing inserts as well, and for that approach I think it makes more sense to make a Point datatypes that extends  clickhouse_connect.datatypes.containers.Tuple.
We probably should have at least one integration test as well.

Thanks for the PR!
I'm a little concerned about the implementation of converting Point to a Tuple(Float64, Float64). It looks like ClickHouse actually sends Point as the type:
CREATE TABLE points
(
    `key` UInt32,
    `value` Point
)
ENGINE = MergeTree
ORDER BY key

INSERT INTO points VALUES(1, (5.22, 7.83));

clickhouse client --port 9007 --query "SELECT * from points FORMAT Native" | xxd

00000000: 0201 036b 6579 0655 496e 7433 3201 0000  ...key.UInt32...
00000010: 0005 7661 6c75 6505 506f 696e 74e1 7a14  ..value.Point.z.
00000020: ae47 e114 4052 b81e 85eb 511f 40<EMAIL_ADDRESS>
It seems we should be consistent and use the Point name when doing inserts as well, and for that approach I think it makes more sense to make a Point datatypes that extends clickhouse_connect.datatypes.containers.Tuple.
We probably should have at least one integration test as well.

Hello, I'm still new to this can you

Thanks for the PR!
I'm a little concerned about the implementation of converting Point to a Tuple(Float64, Float64). It looks like ClickHouse actually sends Point as the type:
CREATE TABLE points
(
    `key` UInt32,
    `value` Point
)
ENGINE = MergeTree
ORDER BY key

INSERT INTO points VALUES(1, (5.22, 7.83));

clickhouse client --port 9007 --query "SELECT * from points FORMAT Native" | xxd

00000000: 0201 036b 6579 0655 496e 7433 3201 0000  ...key.UInt32...
00000010: 0005 7661 6c75 6505 506f 696e 74e1 7a14  ..value.Point.z.
00000020: ae47 e114 4052 b81e 85eb 511f 40<EMAIL_ADDRESS>
It seems we should be consistent and use the Point name when doing inserts as well, and for that approach I think it makes more sense to make a Point datatypes that extends clickhouse_connect.datatypes.containers.Tuple.
We probably should have at least one integration test as well.

I have added Point type in container.py and also added one integration test.
Please let me know if any change is required.

Hi can you please help me debug issue here.
I'm not sure why it's failing.

The failure is not related to your PR, it's something in the test setup.  I'll figure it out in the next day or so.

The failure is not related to your PR, it's something in the test setup. I'll figure it out in the next day or so.

Meanwhile please let me know if any changes in required in code.

Thank you for quick review!!


Implement core_grades functions

Codecov Report

Merging #6 (7a7f2d5) into master (69ad25a) will decrease coverage by 1.09%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master       #6      +/-   ##
==========================================
- Coverage   78.81%   77.71%   -1.10%
==========================================
  Files         227      230       +3
  Lines        5018     5089      +71
==========================================
  Hits         3955     3955
- Misses       1063     1134      +71

Impacted Files
Coverage Δ

moodle/core/grades/__init__.py
0.00% <0.00%> (ø)

moodle/core/grades/base.py
0.00% <0.00%> (ø)

moodle/core/grades/grade.py
0.00% <0.00%> (ø)

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 69ad25a...7a7f2d5. Read the comment docs.

Codecov Report

Merging #6 (7a7f2d5) into master (69ad25a) will decrease coverage by 1.09%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master       #6      +/-   ##
==========================================
- Coverage   78.81%   77.71%   -1.10%
==========================================
  Files         227      230       +3
  Lines        5018     5089      +71
==========================================
  Hits         3955     3955
- Misses       1063     1134      +71

Impacted Files
Coverage Δ

moodle/core/grades/__init__.py
0.00% <0.00%> (ø)

moodle/core/grades/base.py
0.00% <0.00%> (ø)

moodle/core/grades/grade.py
0.00% <0.00%> (ø)

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 69ad25a...7a7f2d5. Read the comment docs.


Command line option for enabling venv auto-activation

From this section: https://github.com/mise-plugins/mise-poetry?tab=readme-ov-file#virtualenv-activation
Is there a way to set this using mise use? I've looked at the docs and didn't find anything relevant. I'd love for there to be an easy way to enable this option (if it doesn't exist), without needing to use a TOML library.

@jdx you mentioned this in https://github.com/jdx/mise/issues/2309


Output export problems

When export the output to a docx file, the images displayed nomarlly in the output window got shortened,just liked been pressed downwards from the top;

When export the output to a pdf file, the images become Ok, but the font of subscripts of symbols become very wierd, i.e., not in harmony with the symbol's main body.

Hi!
Can you please post an example - sample code and screenshot.
Try to set both dimensions of the picture - width and height, e.g.:

Hi!
Can you please post an example - sample code and screenshot. Try to set both dimensions of the picture - width and height, e.g.:

Sorry, I left the code in the PC of my office. However, I am sure that in order to align 3 images in one row orderly, I only define the height as“ heigh:50mm;”. Another reason is that  I don't want to calculate the dimension to keep the width to height ratio to make the image look good.
The fonts in docx and pdf can be testified easy since you hava accumulated a lot of codes.

Hi, again!
Since there is no 1 to 1 compatibility between Html and docx, not everything from Html can work in the same way. I faced the same problem and found that you have to specify both dimensions. I can think about some workaround in the future, but for now, this is the solution.
About the fonts, the problem is that it looks fine on my side:

Maybe you are missing some fonts? Check if you have Calibri and try to reinstall it. Try to open the pdf with another viewer, MS Edge works fine for me, but try a few to see if it will make any difference.

Hi, again!
Since there is no 1 to 1 compatibility between Html and docx, not everything from Html can work in the same way. I faced the same problem and found that you have to specify both dimensions. I can think about some workaround in the future, but for now, this is the solution.
About the fonts, the problem is that it looks fine on my side:

Maybe you are missing some fonts? Check if you have Calibri and try to reinstall it. Try to open the pdf with another viewer, MS Edge works fine for me, but try a few to see if it will make any difference.

So to define both height and width is a must with html, then I will check it.
I see "season" as subscription, and I don't think it's the same font with the "C". On one PC, I understand it should not attribute to font lack.
Anyway, I will check it again on my working PC in office.
One more thing, I like the way you defined the flip_trigger in the example of "SLS Design of Beam with Rectangular Section". I could understand the code fully and well, I learned it from "copy and revision", however, if I want to do a file with multiple cases of image flip trigger, I found it's not  so easy.
I hope this fancy operation could be added into the submenu of Html UI.Is that possible?

No, subscripts are not the same font as variables, but it is the same in the html. This is not a bug, it is made like that on purpose, by design. Subscript letters are smaller and they look better in sans-serif font, while variables are in a serif font. In Word, fonts for the equations are not set. Word works in a different way. All equations in Word use the default font, which is Cambria Math. As I mentioned, not all Html formatting can be converted one-to-one in Word.
BTW, it you want to change the font for the subscript, you can do int in Calcpad with CSS. Try to place the following line on top of your worksheet:
'
If you want to change it permanently, find ".eq sub " in the template (c:\Program Files\Calcpad\template.html) and replace the font there.

Yes, flip_trigger is a nice feature. I will consider embedding it into the application. About multiple flip triggers, one colleague from Italy did such thing. I will find it and post an example here.

Ned.I will try to define the fonts.Another news is that I tried to align images in table and the output to docx is quite good.Just another way.
在 2023-10-07 23:19:22，"Ned Ganchovski" @.***> 写道：
No, subscripts are not the same font as variables, but it is the same in the html. This is not a bug, it is made like that on purpose, by design. Subscript letters are smaller and they look better in sans-serif font, while variables are in a serif font. In Word, fonts for the equations are not set. Word works in a different way. All equations in Word use the default font, which is Cambria Math. As I mentioned, not all Html formatting can be converted one-to-one in Word.
BTW, it you want to change the font for the subscript, you can do int in Calcpad with CSS. Try to place the following line on top of your worksheet:
'
If you want to change it permanently, find ".eq sub " in the template (c:\Program Files\Calcpad\template.html) and replace the font there.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>

Ned,it looks fancy but fragile.I found if you use some #input before the flip trigger selection in one worksheet, it always cause the app to get stuck.Even sometimes you make it run, the flip trigger selection can not work anu more.
Another problem is that since cpdz could be included in a cpd, then the code of cpdz in fact become breached, right? The logic shoud be optimized.
Another unimportant thing is when you click the open menu and pull selct file type to be txt, then browse a drive route. It's supprising that it could not find any txt files in that location.
在 2023-10-08 18:09:25，"Ned Ganchovski" @.***> 写道：
Yes, flip_trigger is a nice feature. I will consider embedding it into the application. About multiple flip triggers, one colleague from Italy did such thing. I will find it and post an example here.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>

Yes, flip_trigger is a nice feature. I will consider embedding it into the application. About multiple flip triggers, one colleague from Italy did such thing. I will find it and post an example here.

I made it to align images in table and the export to docx file is quite good. However, it incurrs the side effect, i.e., the export to pdf with the same output is abnormal for all the images in tables disappeared.

Ned,it looks fancy but fragile.I found if you use some #input before the flip trigger selection in one worksheet, it always cause the app to get stuck.Even sometimes you make it run, the flip trigger selection can not work anu more. Another problem is that since cpdz could be included in a cpd, then the code of cpdz in fact become breached, right? The logic shoud be optimized. Another unimportant thing is when you click the open menu and pull selct file type to be txt, then browse a drive route. It's supprising that it could not find any txt files in that location.

OK. Thank you for your feedback. I will take a closer look.
I would highly appreciate if you also provide sample code or screenshots, when reporting a problem. You have it anyway. Otherwise, it sometimes takes a lot of time to figure out what exactly is the problem and to reproduce it. It is also possible to make it in a different way that works and not reproduce it at all. Especially when Html is involved, it may be just some incomplete Html code that works in the browser, but cannot convert.

Ned,it looks fancy but fragile.I found if you use some #input before the flip trigger selection in one worksheet, it always cause the app to get stuck.Even sometimes you make it run, the flip trigger selection can not work anu more. Another problem is that since cpdz could be included in a cpd, then the code of cpdz in fact become breached, right? The logic shoud be optimized. Another unimportant thing is when you click the open menu and pull selct file type to be txt, then browse a drive route. It's supprising that it could not find any txt files in that location.

OK. Thank you for your feedback. I will take a closer look.
I would highly appreciate if you also provide sample code or screenshots, when reporting a problem. You have it anyway. Otherwise, it sometimes takes a lot of time to figure out what exactly is the problem and to reproduce it. It is also possible to make it in a different way that works and not reproduce it at all. Especially when Html is involved, it may be just some incomplete Html code that works in the browser, but cannot convert.

OK.I will try to feed back in this way.

Try to set both dimensions of the picture - width and height, e.g.:

I tend to use only the width (because I don't want to calculate the aspect ratio and give the new height), and I have seen this also in the word export. I manually corrected it.


Allow for easier extension of OAuth2 grants and add support for OpenID Connect Authorization Code Flow

There have been a few requests to add support for OpenID Connect (OIDC) related extensions to the OAuth2 protocol (#28, #29, #32).
Instead of adding these extensions to the OAuth2 client (making it more complex than it needs to be), I've decided to add a separate OIDC Client, living in its own subdirectory. That way, if you only need the OAuth2 client you can just continue to import it as is. If you do want to use OIDC specific features and APIs you'll be able to import those from https://deno.land/x/oauth2_client/oidc.ts.
The OAuth2 and OIDC clients mostly share the same interface, with the OIDC client marking a few fields of the OAuth2 config required and adding a few extra options (like the URI of the userinfo endpoint).
This PR isn't quite ready to be merged yet, but we're getting there!
To Do

[ ] Fix OAuth2 tests (they're not yet adapted to the refactored implementation of OAuth2 grant classes)
[ ] Add Tests for the OIDC implementation

Future Work
This is a pretty basic implementation of an OIDC client so far.
Apart from the userinfo endpoint (#29), there's additional APIs that OIDC specifies, like

Support for OpenID Provider Discovery
Additional APIs like

The claims parameter
RP initiated logouts
Front- and Backchannel logouts

And then there's APIs that are often used with OIDC, but also apply to OAuth2, like

Token revocation
Token introspection

When this PR is merged I'll create a separate issue to track all these.

I tried your OIDCClient and found out, that it throws an error if I reduce the scope to "openid", because it tries to match the at_hash with a non-existing access_token, because the OpenID provider (at least Google) then just provides the id_token (which is completely fine, if you are only interested in authentication):
An error occurred during route handling or page rendering. Error: Invalid token response: id_token at_hash claim does not match access_token hash
at AuthorizationCodeFlow.validateAccessToken (https://raw.githubusercontent.com/cmd-johnson/deno-oauth2-client/feature/oidc/src/oidc/authorization_code_flow.ts:246:13)
at eventLoopTick (ext:core/01_core.js:183:11)
at async AuthorizationCodeFlow.getToken (https://raw.githubusercontent.com/cmd-johnson/deno-oauth2-client/feature/oidc/src/oidc/authorization_code_flow.ts:206:7)
Should I open a seperate issue for this?


No apparent way to use --bundle-dependencies=all successfully since 1.5.0

Prior to the 1.5.0 release, it was possible to pass --bundle-dependencies=all --prod to get an AoT compiled self-contained bundle that worked for server-side rendering (SSR) under Node.js. Since 1.5.0, these flags produce a bundle that, as far as I can tell, can never work because they now rely on the existence of browser DOM APIs that don't exist in Node.
If there is any way to use --bundle-dependencies=all successfully in --prod build with 1.5.0+, I'd love to know about it.
Versions
Angular CLI: 1.5.4
Node: 6.11.0
OS: win32 x64
Angular: 5.0.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

@angular/cli: 1.5.4
@angular-devkit/build-optimizer: 0.0.33
@angular-devkit/core: 0.0.21
@angular-devkit/schematics: 0.0.37
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.4
@schematics/angular: 0.1.7
typescript: 2.4.2
webpack: 3.8.1

Repro steps

Clone the example repo at https://github.com/SteveSandersonMS/angular-bundledependencies-repro. This is the same as the universal-starter repo, except for one commit that gets as close as I can to a scenario where --bundle-dependencies=all could work (but still doesn't).
Run npm install
Observe that it works fine in a non-prod build by running npm run build:ssr then npm run serve:ssr. If you visit http://localhost:4000, you'll get both server and client rendering.
Observe that if you build in prod mode (run npm run build:ssr:prod then npm run serve:ssr), then it does not work - you'll get this error:

TypeError: StaticInjectorError[InjectionToken DocumentToken]:
  StaticInjectorError[InjectionToken DocumentToken]:
    Right-hand side of 'instanceof' is not an object
    at ke (C:\path\angular-bundledependencies-repro\dist\server.js:4106:724114)
    at xe (C:\path\angular-bundledependencies-repro\dist\server.js:4106:723991)
    at lr (C:\path\angular-bundledependencies-repro\dist\server.js:4106:746752)
    at _n.insertToken (C:\path\angular-bundledependencies-repro\dist\server.js:4106:767718)
    at C:\path\angular-bundledependencies-repro\dist\server.js:4106:726646
    at Fe (C:\path\angular-bundledependencies-repro\dist\server.js:4106:726661)
    at I (C:\path\angular-bundledependencies-repro\dist\server.js:4106:721959)
    at Object.parse (C:\path\angular-bundledependencies-repro\dist\server.js:4106:766648)
    at Object.t.createDocument (C:\path\angular-bundledependencies-repro\dist\server.js:4106:1194422)
    at Object.t.createWindow (C:\path\angular-bundledependencies-repro\dist\server.js:4106:1194526)

If you trace this into the server.js bundle code, what's happening is that it's testing whether someValue instanceof HTMLElement (though it's not obvious at first glance because everything is minified and renamed). That code would be OK in a browser, but it's an error in Node, because HTMLElement is undefined. So the generated bundle isn't going to work for SSR under Node.

If you want, verify that removing --bundle-dependencies=all from lines 22 and 23 in package.json is enough to make it work in both dev and prod builds. So the problem is the combination of --prod with --bundle-dependencies=all - you can use either on their own, but not both together.

Observed behavior
Fails with the Right-hand side of 'instanceof' is not an object error shown above.
Desired behavior
SSR works as it did in the non-prod build.
Mention any other details that might be useful (optional)
The equivalent did work pre-1.5.0 (which was also Angular 4.x).
The reason I'm asking about this is because I'm building new Angular CLI-based ASP.NET templates that will be included in the .NET Core SDK and Visual Studio. We want the template to use --bundle-dependencies=all by default because then developers don't have to publish their node_modules to production, and attempting to publish 20,000+ files from node_modules is extremely time-consuming (and not always reliable) from VS. Plus it tends to hit Windows path-length limitations depending on the deployment target.

@filipesilva any thoughts on this?

@Brocco can you take a look please?

@Brocco did you get a chance to look into this?

Really love to have this nailed down. Thanks guys.

@hansl is it due to the issue reported here https://github.com/angular/angular-cli/issues/8900 ?

@hansl should we expect this and https://github.com/angular/angular-cli/issues/8900 to be solved in V6?
If this could be fixed, it would really help developers using Angular and SSR with Windows technologies (.net core) or hosting Angular apps on Windows servers/IIS/Kestrel.

Personally I would love to have this feature available as soon as possible, but for now I have stopped wasting time and effort on making angular apps universal.
For now the stability of angular universal is good for demo purposes but as soon as you start expanding application to a good scale you start realising the amount of energy required to maintain those features is quite large. I hope in coming days DX will improve to implement SSR in angular apps.

+1

seems still not working with the latest release. Does anyone have an alternative for this?

@SteveSandersonMS
I cloned your repo at https://github.com/SteveSandersonMS/angular-bundledependencies-repro and found a workaround.
If you change this line in package.json
"build:client-and-server-bundles:prod": "ng build --prod && ng build --prod --app 1 --output-hashing=false --bundle-dependencies=all",

with this
"build:client-and-server-bundles:prod": "ng build --prod && ng build --build-optimizer --aot --environment prod --app 1 --output-hashing=false --bundle-dependencies=all",

everything works.
I'm not sure what's different between "--prod" and "--build-optimizer --aot --environment prod", but I think they're almost the same. Also, it's only necessary for the server-side version of the code so if some random optimization is missing it might be okay.

@filipesilva @hansl @Brocco can you please share if there is any update on this?

@speige can you please compare the size of the bundles with --prod and --build-optimizer --aot --environment prod ?

Results of "ng build --prod --app 1 --output-hashing=false --bundle-dependencies=all"

Results of "ng build --build-optimizer --aot --environment prod --app 1 --output-hashing=false --bundle-dependencies=all"

It appears that the --prod bundle is much smaller, but it's also the broken one. Maybe treeshaking was overzealous? Since this is the server build, the larger size shouldn't be an issue. Also, if it's removing the need to copy the entire node_modules folder (or run npm install on my server), I'd happily take the larger size.
Note: There is a separate issue logged about the yellow warning, but I've found in my app that everything still works, so I just ignore the warning.

Thanks for sharing this, I believe the size of the bundle should have an effect on the memory consumption on server as well for heavy traffic websites. For developers using .net technologies, this requires immediate attention from Angular CLI team, its already been ~5 months.

Fyi, I've also tried this on Angular 6 RC & the same issue still exists. The format of angular-cli.json has changed, but the issue & workaround are still the same.
broken:
	"ssr": {
      "root": "",
      "projectType": "application",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:server",
          "options": {
            "outputPath": "dist/ssr",
            "main": "src/main.server.ts",
            "tsConfig": "src/tsconfig.server.json"
          },
          "configurations": {
            "production": {
              "optimization": true,
              "outputHashing": "none",
              "sourceMap": false,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false,
			"bundleDependencies": "all"
            }
          }
        }
      }
    }

working:
	"ssr": {
      "root": "",
      "projectType": "application",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:server",
          "options": {
            "outputPath": "dist/ssr",
            "main": "src/main.server.ts",
            "tsConfig": "src/tsconfig.server.json"
          },
          "configurations": {
            "production": {
              "optimization": false,
              "outputHashing": "none",
              "sourceMap": false,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false,
			"bundleDependencies": "all"
            }
          }
        }
      }
    }

Only difference is optimization: true/false. Without bundleDependencies, both true/false work, with bundleDepencencies: all only optimization: false works.
Also, same error during ng serve (Right-hand side of 'instanceof' is not an object) & same yellow circular dependency warning occur [which I'm ignoring, since it still works]. Although if I remember correctly the yellow warning was about the express/view.js file instead of core.umd.js but that may be because I was on a completely different repo, not Steve's angular-bundledependencies-repro

here is an example with ng6 https://github.com/deebloo/ng6-ssr-error

@speige I tried your Angular 6 RC workaround in Angular 6 final, but it does not work for me.
Have you had any luck getting this to work in Angular 6 final?

@linusbrolin yes, my workaround is still working for me with angular v6 final. Must be something else different in our configurations.

@naveedahmed1 yes I'm aware of that. I was just hoping there was any kind of workaround for now, until it has been fixed. I don't care if the bundle size increases, as long as I can make it work. Thats why I asked about the previous workaround above.

@SteveSandersonMS
After investigation, there's absolutely no reason to use optimizations with a server bundle. We are going to remove uglify and build optimizer configurations from our server build so that modules are tree shaken but there's no dead code elimination and renaming (which breaks some instanceof, for example).
In the meantime, you can disable optimization in v6, and instead of --prod simply use --aot in v1.

I did solve this issue changing my webpack.server.config.js mode to development instead of production
Angular CLI: 6.0.0
Node: 8.9.4
OS: darwin x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.0
@angular-devkit/build-angular     0.6.0
@angular-devkit/build-optimizer   0.6.0
@angular-devkit/core              0.6.0
@angular-devkit/schematics        0.6.0
@ngtools/webpack                  6.0.0
@schematics/angular               0.6.0
@schematics/update                0.6.0
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.7.0

@paulogr I can confirm this solves the issue on my end as well. Thanks for posting!

yes changing the webpack.server.config.js mode to development solved the instanceof error for me aswell, and the page is able to load.
However, instead I get a whole bunch of these errors when loading the page:
ERROR ReferenceError: Node is not defined
    at isTemplateElement (webpack:///./node_modules/@angular/core/fesm5/core.js?:8458:28)
    at getTemplateContent (webpack:///./node_modules/@angular/core/fesm5/core.js?:8453:65)
    at _sanitizeHtml (webpack:///./node_modules/@angular/core/fesm5/core.js?:8445:28)
    at DomSanitizerImpl.sanitize (webpack:///./node_modules/@angular/platform-browser/fesm5/platform-browser.js?:1921:92)
    at setElementProperty (webpack:///./node_modules/@angular/core/fesm5/core.js?:9404:61)
    at checkAndUpdateElementValue (webpack:///./node_modules/@angular/core/fesm5/core.js?:9356:13)
    at checkAndUpdateElementInline (webpack:///./node_modules/@angular/core/fesm5/core.js?:9303:24)
    at checkAndUpdateNodeInline (webpack:///./node_modules/@angular/core/fesm5/core.js?:11639:20)
    at checkAndUpdateNode (webpack:///./node_modules/@angular/core/fesm5/core.js?:11605:16)
    at prodCheckAndUpdateNode (webpack:///./node_modules/@angular/core/fesm5/core.js?:12149:5)

To attempt to fix that, I tried setting these options in the server portion of angular.json:
"optimization": false,
"bundleDependencies": "all"

But then I instead get the following error on build:
webpack:///./dist/server/main.js?:85048
        __metadata("design:paramtypes", [Document, core_1.NgZone])
                                         ^

ReferenceError: Document is not defined
    at eval (webpack:///./dist/server/main.js?:85048:42)
    at Object.module.exports (webpack:///./dist/server/main.js?:85051:2)
    at __webpack_require__ (webpack:///./dist/server/main.js?:81927:30)
    at Object.c (webpack:///./dist/server/main.js?:84824:20)
    at __webpack_require__ (webpack:///./dist/server/main.js?:81927:30)
    at Object.c (webpack:///./dist/server/main.js?:88925:27)
    at __webpack_require__ (webpack:///./dist/server/main.js?:81927:30)
    at module.exports (webpack:///./dist/server/main.js?:81970:18)
    at eval (webpack:///./dist/server/main.js?:81973:10)
    at webpackUniversalModuleDefinition (webpack:///./dist/server/main.js?:81905:20)

@hansl is there any update on this? I have below configuration for ssr app in angular.json file:
    "ssr": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:server",
          "options": {
            "outputPath": "dist-server",
            "main": "src/main.server.ts",
            "tsConfig": "src/tsconfig.server.json",
            "progress": true
          },
          "configurations": {
            "production": {
              "optimization": false,
              "outputHashing": "media",
              "sourceMap": false,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false,
              "bundleDependencies": "all"
            }
          }
        }
      }
    }

Two issues:
If I set "optimization": true, it still breaks the app.
Secondly, though I have "bundleDependencies": "all" but instead of generating one bundle for the ssr app, I see one main bundle and several small bundles. As a result the total size of my server app bundles is now. 28.5mb. With previous version of Angular CLI it was around 5Mb.
I am using @angular/cli version 6.0.3

@hansl @filipesilva what if we update the Uglify settings to preserve the class names for server builds? I believe this would be a better solution than to turn mangle off. What do you think?

@filipesilva  @hansl did you get a chance to check my last comment of Jun 10?

This is a huge issue because lots of people wants to use Angular Universal with ASP.NET Core backend. Could you please prioritize this to the top?

I've tried every suggestion in this thread, but still run into this issue:
Error: No NgModule metadata found for '[object Object]'.     at NgModuleResolver.resolve (C:\project\node_modules\@angular\compiler\bundles\compiler.umd.js:20020:27)     at CompileMetadataResolver.getNgModuleMetadata (C:\project\node_modules\@angular\compiler\bundles\compiler.umd.js:18662:47)     at JitCompiler._loadModules (C:\project\node_modules\@angular\compiler\bundles\compiler.umd.js:26085:55)     at JitCompiler._compileModuleAndComponents (C:\project\node_modules\@angular\compiler\bundles\compiler.umd.js:26066:40)     at JitCompiler.compileModuleAsync (C:\project\node_modules\@angular\compiler\bundles\compiler.umd.js:26026:41)     at CompilerImpl.compileModuleAsync (C:\project\node_modules\@angular\platform-browser-dynamic\bundles\platform-browser-dynamic.umd.js:202:35)     at C:\project\node_modules\@nguniversal\express-engine\bundles\express-engine.umd.js:110:29     at new ZoneAwarePromise (C:\project\node_modules\zone.js\dist\zone-node.js:910:29)     at getFactory (C:\project\node_modules\@nguniversal\express-engine\bundles\express-engine.umd.js:96:16)     at C:\project\node_modules\@nguniversal\express-engine\bundles\express-engine.umd.js:75:17

We have a fix to the ng add schematics for 8.0 for this.(PR above)
But to manually fix your existing project - Move all Angular related imports in server.ts as re-exports in main.server.ts and then you can use --bundleDependencies all. Would also need to change the top-level webpackconfig to main.ts external to server.ts builds.
Shown in example repo here -
https://github.com/vikerman/v8-lazy/commit/515239be1b233946e4a1d15a8712a0bc9f5490cc
With this you should need to deploy only dist/server.js and dist/server/main.js and node_modules.

@dominikfoldi @stefankip - can you try the suggestion above?

@vikerman our Angular project is not ejected so I cannot modify the webpack.config. I can wait until Angular 8. Glad to hear that you have a fix!

@dominikfoldi - Not sure what your setup is. But essentially the fix would be to move all references to @angular and @nguniversal to the main.server.ts and bundle it once there and use only re-exports from the express(or whichever) entry point. Otherwise you would end up with two copies of Angular and things will start to fail randomly.

@vikerman
I can confirm the 'fix' works ;)
The only problem is that I now have the original error:
TypeError: StaticInjectorError[InjectionToken DocumentToken]:
  StaticInjectorError[InjectionToken DocumentToken]:
    Right-hand side of 'instanceof' is not an object

Like already said in this issue disabling optimization fixes this.
I'll do this for now until this issue is completely fixed
Again thx for your effort & the example repo

@vikerman awesome, works perfectly! Thank you very much!

Closing this as we have some reports that this works.

@vikerman I think the issue still exists "bundleDependencies": "all", works only when "optimization": false, but when "optimization": true, it throws below error
NodeInvocationException: StaticInjectorError(AppServerModule)[InjectionToken Application Initializer -> InjectionToken DocumentToken]:
StaticInjectorError(Platform: core)[InjectionToken Application Initializer -> InjectionToken DocumentToken]:
Right-hand side of 'instanceof' is not an object
TypeError: StaticInjectorError(AppServerModule)[InjectionToken Application Initializer -> InjectionToken DocumentToken]:
StaticInjectorError(Platform: core)[InjectionToken Application Initializer -> InjectionToken DocumentToken]:
Right-hand side of 'instanceof' is not an object

@vikerman how about this https://github.com/angular/angular-cli/issues/8616#issuecomment-396058214 ?

Ok I have found one solution.

Disable optimizations i.e. "optimization": false, in angular.json file.
Enable bundle dependencies "bundleDependencies": "all", in angular.json file.
Build your bundle (in my case npm run build:ssr). This will generate a large bundle., in my case the size of the bundle is 9.89Mb with IVY Enabled.
Install terser plugin npm install terser -g
Run terser to minify bundle terser dist-server/main.js -o dist-server/main.js -c -m --keep-fnames. The compressed build in my case is of 3.9mb i.e. ~60% reduction.

Please do share feedback and suggestions for further improvements.


Fix Compliation Errors for Xcode 15

Goal

Get Bugsnag-Cocoa Library to compile on Xcode 15.0.1 and above.

Design

Initial Error Darwin.POSIX.sys.types' appears within extern "C" language linkage specification. The #include <sys/types.h> contains C++ code. When nested in extern "C" block the code is expected be only C, so the solution is to move the include outside of the extern. This seems to be a new error with the complier that ships with XCode 15.

Second Error after moving the include Declaration of 'size_t' must be imported from module 'Darwin.C.stddef' before it is required, this just necessitated including <stddef.h> in the extern C again.

Changeset

Needed to change the order of include statements and add missing header for C code.

Testing

tested compiling and running Bugsnag code in our app.

LGTM
The same change is what I did in order to fix the code on my project

Hi,
Thank you for opening this PR. We do have an item on our backlog aimed at fixing this issue. We don't have an ETA on the release of this, but we'll be sure to update you once we have more info.

@neil477 – thanks for this fix. Just to let you know we've included part of it in #1608, which has now been released in v6.27.3.
We were unable to reproduce the second issue you mention with the <stddef.h> include. Perhaps you can give it a re-test on the latest release and let us know if you see any issues?


Allow overwriting the runs-on: field of the workflows

To support self-hosted runners

Not merged to upstream


New version: OpenMedia.4KVideoDownloaderPlus version <IP_ADDRESS>7

Pull request has been created with komac v2.3.0 :rocket:
Microsoft Reviewers: Open in CodeFlow

Automatic Validation ended with:

2024-06-18 09:44:48.270 [CLI ] No suitable installer found for manifest Microsoft.VCRedist.2015+.x64 with version 14.40.33807.0
2024-06-18 09:44:20.202 [CLI ] No suitable installer found for manifest Microsoft.VCRedist.2015+.x86 with version 14.38.33135.0

(Automated response - build 886.)


Tests fail for App if imported plugins are exported on the same line

Expected Behavior

Plugins are being exported to the App In app/src/plugins.ts.
A plugin should be able to be exported with an import on the same line using ES6 syntax without test failing.
export { default as HomePagePlugin } from '@backstage/plugin-home-page';
export { default as WelcomePlugin } from '@backstage/plugin-welcome';

Current Behavior

Currently, plugins are first imported, then exported:
import { default as HomePagePlugin } from '@backstage/plugin-home-page';
import { default as WelcomePlugin } from '@backstage/plugin-welcome';
export { HomePagePlugin, WelcomePlugin };

Otherwise, App.test.js will fail with:
 yarn run v1.22.1
$ backstage-cli test
 FAIL  src/App.test.tsx
  ● Test suite failed to run

    Plugin 'undefined' is already registered

      33 |         for (const p of plugin) {
      34 |             if (this.plugins.has(p)) {
    > 35 |                 throw new Error(`Plugin '${p}' is already registered`);
         |                       ^
      36 |             }
      37 |             this.plugins.add(p);
      38 |         }

      at AppBuilder.Object.<anonymous>.AppBuilder.registerPlugin (../../core/dist/cjs/api/app/AppBuilder.js:35:23)
      at Object.<anonymous> (App.tsx:46:19)
      at Object.<anonymous> (App.test.tsx:19:1)

  console.warn ../../node_modules/react/cjs/react.development.js:315
    Warning: React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        23.981s
Ran all test suites.

Command 'web-scripts' exited with code 1

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The reason for the above error is that the exports in plugins.ts is being imported as undefined which then gets registered in the App, which cannot handle two plugins with the same name.
Possible Solution

Look into why this is happening for tests only. Possibly a jest setting somewhere?
Steps to Reproduce (for bugs)

Change the import/export statement in plugins.ts
Run yarn test in packages/app

Context

Your Environment

NodeJS Version (v12):
Operating System and Version (e.g. Ubuntu 14.04):
Browser Information:

@marcuseide it might have something to do with the order of imports and exports. I printed the value of the variable plugins in App.tsx and gave me this:
console.log src/App.tsx:1271
    { HomePagePlugin: undefined, WelcomePlugin: undefined }

it is being imported from plugins.ts before they have any value. I don't know if that was what you were referring to.

@braulio-balanza Right, that's the symptom we were seeing - question is why, and why only in tests, and what to do about it.

I tried repro-ing this issue with a similar setup with react-script, jest and ts here
The exports seem to work and I can see that the plugins object is a valid one
plugins ==> {
  SamplePlugin: [Function: SamplePlugin],
  FooPlugin: [Function: FooPlugin]
}

If I change the lines in plugins.ts  to
export * as HomePagePlugin from '@backstage/plugin-home-page';
export * as WelcomePlugin from '@backstage/plugin-welcome';

then the plugins object in App.tsx looks like this
    plugins ==> {
      HomePagePlugin: {
        config: { id: 'home-page', register: [Function: register] },
        default: Plugin { config: [Object] }
      },
      WelcomePlugin: {
        config: { id: 'welcome', register: [Function: register] },
        default: Plugin { config: [Object] }
      }
    }

This issue is no longer valid after https://github.com/spotify/backstage/pull/526

@soapraj oh yeah good point :grin:
We should update the logic in create-plugin and close this. We still have the issue of forwarding of default exports not working in tests though I guess, so probably open an issue detailing that instead.

Actually, after alpha.4 I can't replicate the error anymore.


got error in optimize onnx when ran gpt2 file from demo/generative-model

getting error when ran this code part
logging.basicConfig()
logging.getLogger().setLevel(logging.INFO)
num_attention_heads, hidden_size = get_model_size(path=model_name)
optimize_onnx(
onnx_path="test-gpt2.onnx",
onnx_optim_model_path="test-gpt2-opt.onnx",
fp16=True,
use_cuda=True,
num_attention_heads=num_attention_heads,
hidden_size=hidden_size,
architecture='gpt2'
)
INFO:fusion_base:Fused LayerNormalization count: 25
INFO:fusion_base:Fused FastGelu count: 12
failed in shape inference <class 'AssertionError'>
failed in shape inference <class 'AssertionError'>
failed in shape inference <class 'AssertionError'>
INFO:onnx_model:Graph pruned: 0 inputs, 0 outputs and 720 nodes are removed
INFO:onnx_model_gpt2:postprocess: remove Reshape count:72
INFO:fusion_base:Fused FastGelu(add bias) count: 12
INFO:onnx_model_bert:opset verion: 13

AssertionError                            Traceback (most recent call last)
 in ()
9     num_attention_heads=num_attention_heads,
10     hidden_size=hidden_size,
---> 11     architecture='gpt2'
12 )
7 frames
/usr/local/lib/python3.7/dist-packages/onnxruntime/transformers/../tools/symbolic_shape_infer.py in add_suggested_merge(self, symbols, apply)
209
210     def add_suggested_merge(self, symbols, apply=False):
--> 211         assert all([(type(s) == str and s in self.symbolic_dims) or is_literal(s) for s in symbols])
212         symbols = set(symbols)
213         for k, v in self.suggested_merge.items():
AssertionError:

you got that error just by running the notebook?

the error resolved , by reinstalling, but got new error in tensor rt engine build
from pathlib import Path
trt_logger: Logger = trt.Logger(trt.Logger.ERROR)
runtime: Runtime = trt.Runtime(trt_logger)
trt_model_name = "test-gpt2.plan"
create only of does not exist because it's slow to run...
if not Path(trt_model_name).exists():
engine: ICudaEngine = build_engine(
runtime=runtime,
onnx_file_path="test-gpt2.onnx",
logger=trt_logger,
min_shape=(1, 1),
optimal_shape=(1, 128),  # num beam, batch size
max_shape=(1, 128),  # num beam, batch size
workspace_size=10000 * 1024**2,
fp16=True,
int8=True,
)
save_engine(engine, trt_model_name)

I just rerun code and have not this issue. Can you try with the Docker file to check if this is caused to your local setup?

ok, I'll try docker file

btw, we just released support for T5 in case you are interested (notebook in same folder than GPT2)

Made more tests, TensorRT 8.4 (preview) is broken on GPT-2 but <IP_ADDRESS> has a fix.
It's not the error you get (TRT is used after ORT optimization) but is something to have in mind.
I have pushed a re generated notebook, just deleted 2 args in pytorch ONNX export (those args have been removed in Pytorch 1.11).

closing as there is no activity since > 1 month and the question has been answered


Possible Qt segfault (crash with no traceback)

Sometimes the app suddenly crashes with no traceback. That likely means it's happening in C++ (Qt) due to invalid memory access.
This seems fairly difficult to debug. From a bit of reading, it seems one common cause is conflict between ownership of objects between python and Qt. So I can start by reviewing the widget and layout hierarchy, who owns what, and what happens when individual widgets are garbage collected.
Multithreaded processing is another likely culprit.

It's likely the multithreading. I've temporarily set the worker thread count to 1 (configurable in settings file).

Got a partial trace with gdb:
#0  0x00007fffc3bf76c3 in ?? ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Widgets.so.6
#1  0x00007fffc3bf7833 in ?? ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Widgets.so.6
#2  0x00007fffc3bcb8ea in ?? ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Widgets.so.6
#3  0x00007fffca84a7ca in ?? ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Core.so.6
#4  0x00007fffca84292f in QObject::destroyed(QObject*) ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Core.so.6
#5  0x00007fffc3b763fb in QWidget::~QWidget() ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Widgets.so.6
#6  0x00007fffc44317d0 in ?? ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/QtWidgets.abi3.so
#7  0x00007fffca8433b2 in QObjectPrivate::deleteChildren() ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Core.so.6
#8  0x00007fffc3b76408 in QWidget::~QWidget() ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Widgets.so.6
#9  0x00007fffc4262904 in ?? ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/QtWidgets.abi3.so
#10 0x00007fffca83dcb0 in QObject::event(QEvent*) ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Core.so.6
#11 0x00007fffc3b234f2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Widgets.so.6
#12 0x00007fffca7ec18a in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Core.so.6
#13 0x00007fffca7ef63d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Core.so.6
#14 0x00007fffcaaa3e93 in ?? ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Core.so.6
#15 0x00007fffc81afd3b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007fffc82052b8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007fffc81ad3e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007fffcaaa376a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Core.so.6
#19 0x00007fffca7f7963 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Core.so.6
#20 0x00007fffca7f441e in QCoreApplication::exec() ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/Qt/lib/libQt6Core.so.6
#21 0x00007fffc45ffcbb in ?? ()
   from /home/jcook/.virtualenvs/naturtag/lib/python3.11/site-packages/PySide6/QtWidgets.abi3.so
#22 0x00007ffff7ba0ee2 in cfunction_vectorcall_NOARGS (func=0x7fffc495a5c0, args=<optimized out>,
    nargsf=<optimized out>, kwnames=<optimized out>) at Objects/methodobject.c:486
#23 0x00007ffff7b4f5a8 in _PyObject_VectorcallTstate (kwnames=<optimized out>, nargsf=<optimized out>,
    args=<optimized out>, callable=0x7fffc495a5c0, tstate=0x7ffff7f775d8 <_PyRuntime+166328>)
    at ./Include/internal/pycore_call.h:92
#24 PyObject_Vectorcall (callable=0x7fffc495a5c0, args=<optimized out>, nargsf=<optimized out>,
    kwnames=<optimized out>) at Objects/call.c:299
#25 0x00007ffff7af173b in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>,
    throwflag=<optimized out>) at Python/ceval.c:4774
#26 0x00007ffff7c493cf in _PyEval_EvalFrame (throwflag=0, frame=0x7ffff79e41b8,
    tstate=0x7ffff7f775d8 <_PyRuntime+166328>) at ./Include/internal/pycore_ceval.h:73
--Type <RET> for more, q to quit, c to continue without paging--
#27 _PyEval_Vector (args=0x0, argcount=0, kwnames=0x0, locals=0x7ffff73dea00, func=0x7ffff73ba020,
    tstate=0x7ffff7f775d8 <_PyRuntime+166328>) at Python/ceval.c:6439
#28 PyEval_EvalCode (co=co@entry=0x555556d81fc0, globals=globals@entry=0x7ffff73dea00,
    locals=locals@entry=0x7ffff73dea00) at Python/ceval.c:1154
#29 0x00007ffff7c452a0 in builtin_exec_impl (module=<optimized out>, closure=<optimized out>,
    locals=0x7ffff73dea00, globals=0x7ffff73dea00, source=0x555556d81fc0) at Python/bltinmodule.c:1077
#30 builtin_exec (module=<optimized out>, args=<optimized out>, nargs=<optimized out>, kwnames=<optimized out>)
    at Python/clinic/bltinmodule.c.h:465
#31 0x00007ffff7ba0c76 in cfunction_vectorcall_FASTCALL_KEYWORDS (func=0x7ffff7370f90, args=0x7ffff79e4180,
    nargsf=<optimized out>, kwnames=<optimized out>) at Objects/methodobject.c:443
#32 0x00007ffff7b4f5a8 in _PyObject_VectorcallTstate (kwnames=<optimized out>, nargsf=<optimized out>,
    args=<optimized out>, callable=0x7ffff7370f90, tstate=0x7ffff7f775d8 <_PyRuntime+166328>)
    at ./Include/internal/pycore_call.h:92
#33 PyObject_Vectorcall (callable=0x7ffff7370f90, args=<optimized out>, nargsf=<optimized out>,
    kwnames=<optimized out>) at Objects/call.c:299
#34 0x00007ffff7af173b in _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>,
    throwflag=<optimized out>) at Python/ceval.c:4774
#35 0x00007ffff7c49531 in _PyEval_EvalFrame (throwflag=0, frame=0x7ffff79e4020,
    tstate=0x7ffff7f775d8 <_PyRuntime+166328>) at ./Include/internal/pycore_ceval.h:73
#36 _PyEval_Vector (tstate=0x7ffff7f775d8 <_PyRuntime+166328>, func=<optimized out>, locals=<optimized out>,
    args=<optimized out>, argcount=<optimized out>, kwnames=<optimized out>) at Python/ceval.c:6439
#37 0x00007ffff7cb5fd7 in pymain_run_module (modname=<optimized out>, set_argv0=set_argv0@entry=1)
    at Modules/main.c:300
#38 0x00007ffff7cb66e3 in pymain_run_python (exitcode=0x7fffffffdab0) at Modules/main.c:595
#39 Py_RunMain () at Modules/main.c:680
#40 0x00007ffff7cb6f6e in pymain_main (args=0x7fffffffdbd0) at Modules/main.c:710
#41 Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:734
#42 0x00007ffff77e2d90 in __libc_start_call_main (main=main@entry=0x555555555060 <main>, argc=argc@entry=3,
    argv=argv@entry=0x7fffffffdd58) at ../sysdeps/nptl/libc_start_call_main.h:58
#43 0x00007ffff77e2e40 in __libc_start_main_impl (main=0x555555555060 <main>, argc=3, argv=0x7fffffffdd58,
    init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdd48)
    at ../csu/libc-start.c:392
#44 0x0000555555555095 in _start ()