PhoneUI improvements

The PhoneUI is intimidating for new users, who are dropped into the app without any introduction or explanation.
@bogdan-calapod has some good ideas on ways to fix it.

Hey there 😁
I've attached a zip file containing all the exported assets and exported PNG images of each of the screens, as well as the .xd file and a screen recording of the user flow through the app.
🎥 XD file & recording - App Mockup.zip
📁 Assets - AndroidAutoIDrive.zip

I'm trying to get started with the mockups again and make a complete flow, but I'm a bit swamped with time these days :(
So what I'm thinking is to make a basic overview of the screens that we'll need, and start from there.
I'm thinking:

🏠 Home screen

Displays current app status (e.g. if the app is connected, if a music app is playing, etc.)
Can also display some guidance steps for the user if this is the first setup

🎵 Music screen

Displays the current playing screen, if any (e.g. the current "Now Playing" screen when tapping a media app)

🚗 Vehicle info screen

Show a "BMW Connected"-like screen, with info such as the range, fuel level, service intervals, etc. - I'm thinking if we could pull these from the car we can cache them and show them when the app is not connected
Show various info that "looks cool" but also helps with debugging and stuff 😃 I'm sure @hufman can come up with some cool stuff to show here ?

🔧 Configuration screen

Displays configuration options such as the current messaging options (are message notifs enabled, notif popups)
Displays application list to allow the user to select which apps to get notifications from
Displays voice assistant settings (I don't know if this should be a separate option ? Apart from enabling/disabling I don't think we need too much here, right ?)
We could also add configuration options for the #131 screen - I'm thinking to allow the user to define locations that the app can trigger with Google Maps via a location link, and showing them in the in-car app when no Google Maps notification is active

This is what I've got for now, but I'm sure that I missed something - let me know what you think :D When we have this list more or less established I'm going to add a task list to this issue so we can track the pages better.

It's all good! I've been busy working on other parts of the app, and still have maybe another month before I'm ready to start tackling the phone UI 👍
That's a good list, all the most important parts for users! I was thinking of organizing it with a hamburger side menu instead of tabs to match the Connected app, and to easily support a bigger list of main features:

Home/Connection/Status
I plan on showing a checklist of supported features near here (Bluetooth apps, music context worded somehow, navigation, notification popups, TTS)
The details and tips for the connection status will move here, from the too-hidden screen where it is now
Music
Navigation (trigger car navigation from a pasted-in address, explain the Google Maps link handler)
Notifications (permission prompts, quick replies, list of recent notification apps for disabling?)
Voice Assistant (showing tips for setup, I suppose a enable toggle would be easy enough to help fill out space)
Other settings, if they can't be categorized into above?
Support/Donations #129

I do plan on remembering the information about the last car, to show information about the supported features in the relevant tabs (greying out Popups if the current/last car is IDrive5+, for example). I'm not sure about showing the same information about the official Connected app, since it also caches most of that information, but perhaps a default-hidden tab for more advanced details might be fun for other nerds! (Unless, does Connected not show that information if the ConnectedDrive subscription isn't live? That might be a reason to add that info)
Interesting thought about a list of destinations to open with Google Maps! I'm not sure how it would work differently than Google Maps' own recent list. I hope that #131 should be automatic enough to not need any options, what are you thinking about?
As for the resources, attaching screenshots and zip files seems to be a good workflow to me, if you don't want to use up your OneDrive space for historical purposes?
Thank you so much for working on this!

I was thinking of organizing it with a hamburger side menu instead of tabs to match the Connected app, and to easily support a bigger list of main features

Agreed - I think it makes more sense, and makes my life easier as well 😅

Interesting thought about a list of destinations to open with Google Maps! I'm not sure how it would work differently than Google Maps' own recent list. I hope that #131 should be automatic enough to not need any options, what are you thinking about?

I was thinking that you could auto-launch Google Maps from the car to a certain navigation - I think it wasn't clear enough that I was talking about the car UI 😃 If we could pull the recent places from Maps and display them in the car, then trigger the navi (e.g. Google Maps navi, not the in-car system if it exists) from there, that would be awesome. If not - the user could define a list of "favorite places" and we could display that if no active navigation (e.g. Google Maps notification) is present.

As for the resources, attaching screenshots and zip files seems to be a good workflow to me, if you don't want to use up your OneDrive space for historical purposes?

I can store them on OneDrive no problem - I already store them there anyways 😃

Thank you so much for working on this!

Thank you so much for making this project a thing - it really shows the full power of what can be done with dedication and interest! 💪

About this subject, It would be Nice to add an option to mirror the main menu on the right part of the screen, for an Easy use with the right hand only (sometimes in the car you May Need to touch something in the settings.. i know that while driving the phone shall not be used in any case, but i drop this idea here anyway :)
I also look forward to the "car info" Tab, It would be a Nice feature to add

@berseker you mean adding an option to flip the sidebar to come from the right side ?
I think that's easy to implement, although a bit unorthodox WRT Android's UX guidelines. What I've seen most apps migrate to is having the main actions in a bottom bar (something similar to what new-ish apps like Google Maps have done recently)

@bogdan-calapod exactly. by looking at this link the positioning is "reccomended" only, and it is allowed specifically for right-to-left languages
https://material.io/components/app-bars-top#anatomy
also a bottom bar could be a nice & more usable alternative in my opinion ;)

What settings do you find yourself needing to change while driving? I intend the phone interface to only be needed for initial setup, with the car interface providing any additional quick options like the Notification settings.
I opted for the slide-out menu because of the clearer presentation of the number of features in the app, with each major area of functionality having its own dedicated tab. The guidelines suggest that a bottom navbar is only for a very limited number of options (3-5 per the docs). There was also the idea of behaving similarly to the Connected app, which was also using a sidebar (granted, MyBMW now has a 3-item bottom navbar heh).
The home screen should show you some basic information about your car and a list of app features that your car supports. If you enable Advanced Options, a new Connection tab will be present (and clicking the connection status icons will also bring you here). With the Advanced Options enabled, it will show you some extra detailed information about your car, such as the full list of car capabilities and some selected data points from the car. What additional car information would you like to show?

I found a bit difficult to reach the main menu during drive since it is placed on the left. that was only my suggestion, to put an option to "mirror" it to the right part of the screen. but I also understand that some Android guidelines must be followed to prepare an app interface.
about the "bottom bar", I think that a main menu of 5 items could be used. I'll try to work on a mockup in order to show you some ideas :D but in any case also the interface like it is , it's ok I think
about the "additional car infos" I was talking about the "Vehicle info screen" mentioned by @bogdan-calapod on 26 October, with some "connected drive app" infos like car range, remaining fuel, but also oil temperature and other "semi-hidden" infos on BMW like some dedicated apps like bimmerlink or carly do (see a sample screenshot below)

If i'm not mistaken, your app does extract these infos from the connection and already shows some of them in the "connection tab"

@hufman I made a mockup of my idea.. please note that this is only a brainstorming that maybe could be useful to improve the (already fantastic) app, if some concept expressed are not feasible or simply against Android interface rules\other "guidelines" you are trying to follow in the interface, feel free to label this mockup as "not useful\trash" :D

ps maybe point 4 of my mockup could be dedicated to some sort of "Vehicle info screen" as hypotized also by @bogdan-calapod in October

@berseker the point of the mockup is just what you did - make people understand what you mean 😄 So I think your mockup is very valuable!
I can try to play a bit in XD this weekend, see if I can draw something up along the lines you presented - there are some valid and nice points (the panoramic dashboard view I think is a really cool idea!)

about that dashboard, I think that the best could be replicate if possible some sort of image like that mockup also directly on the car screen :D

With BMW Connected going away and MyBMW not supporting ID4 cars without Remote Data access, I think it makes more sense now to add a Car Information tab to show some of the previously available information (odometer, fuel level, etc).

MyBMW doesn't support ID5 cars with subscription as well.
Please consider to also to cache some of this values (odometer, fuel level, etc). in app, so you can view them without connection

Definitely possible, the work around bringing CDS values into the PhoneUI unlocks this easily. For example, the car's language shown in the Settings is a cached CDS value.
The CarInformationUpdater class would just need to register for more data points to be available all the time as opposed to the data points in the Connection tab that are only updated while the tab is visible. Then a new Car Information tab will always have access to these values, even when not connected.

I posted an updated build of the first_start branch, I'd appreciate feedback on this concept!

Very nice welcome screens! I would add some "images" on every screen in order to fill up the empty space ( I do not know if you can specify only on High res screens) in any case very good job! I really like the "unbranded brand" icons 😃

I Like it very much but I want to share the following thoughts.
I am no laywer but I do not think the Mini or BMW Logos should be used inside the app. I think this ist even more important If the release to the app store should happen (#212). There might be some Copyright issues with the Logo and maybe even with the name IDrive.
Just wanted to leave this here as a side note.

It's hard to say for certain, and different regions have different laws about it. There's precedent for the companion apps like Spotify showing a splash screen displaying the official brand icon, so I believe that including a reminiscent but different icon is safe. The iDrive name is similar: The official branding for companion apps is ConnectedDrive, with IDrive only being the headunit system itself. Some examples of fair use seem to apply, such as referring to a company's trademark without claiming to be endorsed or provided by it.
BMW does know about the project (has reached out and said it was neat) yet hasn't taken any sort of action towards it. I think by clearly indicating its unofficial nature, any trademark infringement is avoided, and users aren't confused into thinking it's an official app and demanding official support from BMW.

I posted a branch with a new Car Information tab, check out it out!

Tested new car info tab and works & look fine. Thanks for great work.
Based on my previous testing I'd add following info:
1.
CDS.NAVIGATION.CURRENTPOSITIONDETAILEDINFO to "currentPositionDetailedInfo", => address, work ok only in big cities, on rural areas often show only generic info about countryside you are in. That why both the info are needed & useful.
CDS.NAVIGATION.GPSPOSITION to "GPSPosition", => exact coordinates -> link to GMAP
CDS.NAVIGATION.GPSEXTENDEDINFO to "GPSExtendedInfo" => altitude
with link to GMaps. Very useful in foreign cities when you look where you park your car.

CDS.ENGINE.TEMPERATURE to "temperature", => engine & oli temp.
CDS.DRIVING.AVERAGECONSUMPTION value for second computer + additional data (average speed, distance, time)
CDS.SENSORS.BATTERY to "battery" in petrol cars it shows the battery charge level and indirectly condition when fully charged. If possible cache the max value reported and present after actual in brackets.
CDS.DRIVING.PARKINGBRAKE to "ParkingBrake" - it's sometime not reported by car:/ but I know it useful for women :)
CDS.DRIVING.SPEEDACTUAL  (CDS.DRIVING.SPEEDDISPLAYED)
Add revision of the i-level of the car: it in the line NBTevo_ID5_1911_Release ID5_1911-490-1922L

1911 - is the main i-level of the car
490-1922L is the actual SW version

Optionally, live car stats:
CDS.ENGINE.TORQUE to "torque",
CDS.ENGINE.RPMSPEED to "RPMSpeed",
CDS.DRIVING.GEAR to "gear", // I can prepare mapping if you dont have.
CDS.DRIVING.ACCELERATION to "acceleration",
CDS.DRIVING.ACCELERATORPEDAL to "acceleratorPedal",
CDS.SENSORS.TEMPERATUREINTERIOR to "temperatureInterior",
CDS.SENSORS.TEMPERATUREEXTERIOR to "temperatureExterior",

Error: After longer ride i noticed the range on petrol is not refreshing as rest of data. I got new odometer reading, last update date but range not.
Moreover, we can add one more value: Last trip distance, where we calculate last odometer value from engin start time and substruct it from actual value.
As a next step we could visualise the reading (especially: rpm, gear, engin/oil, acceleration/brake, g-meter in a FIA rally style or Aventador). That would be awesome. Everything with live data.

@hufman  quick questions:

How Can I read unchaced data in CarDrivingStatsMode.kt?
Now I have something like that but unfortunatelly it return null:
val speedActual = carInfo.cdsData.liveData[CDS.DRIVING.SPEEDACTUAL].map {
it.tryAsJsonObject("speedActual")?.tryAsJsonPrimitive("speedActual")?.tryAsDouble
}.format("%.0f").addUnit(unitsAverageSpeedLabel)

Where I can find temperature because CDS.VEHICLE.UNITS to "Units", in CarAdvanceInfoFragment.kt is returning Null for Me :/ If you have full units json please sent and let me know why I got null answer ?

Have you seen values for Driving Computer 2 for distance and time ?

We have Torque in the cds values, but is the also actual engine power used (horse power) (In sport displays in HMI we home engine power and torgue)

I'll try to prepare some update and do PR with some of the point mentioned above. Already done point 2,3,4 and started to work on 5-6 and additional, but I failed as I cant read real values as shown above.

Good morning! Thanks for the feedback, I'll incorporate it soon into the branch, planning to merge CarDrivingStatistics with  only the after-drive info implemented to clear the way for you to add the live statistics. I don't have good design sense, so I will leave the gauge displays up to you :)
The petrol range is intended to be updating, I'll take a look.
For your SpeedActual null, you can skip the tryAsJsonObject step: This is for something like, say, GPSPosition, where it would tryAsJsonObject("GPSPosition")?.tryAsJsonPrimitive("latitude").
An example Units json is found on this page, and with the knowledge that this was taken from an American car built in Germany, you can figure that the sample temperature:2 units mean Fahrenheit and that 1 would be the sensible Celcius units. The Units block definitely shouldn't be null! I just hadn't implemented parsing the Temperature units because of the after-drive type of data I wanted to show in this first implementation.
Also on that page you can see the Driving Computer 2, I haven't seen any valid results for Computer 2 and perhaps my Mini just doesn't implement it.
I haven't seen a horsepower data point. Perhaps it's somehow calculated from the acceleration, accelerator pedal, and gear positions? I found this M Laptimer app which I should look at to see what it's doing, but I haven't found an Android version of the old Mini Sports Displays app

M LapTimer was actually what had in my mind asking for engine power and proposing some gauges like FIA. However, I don't think M Lap Timer was for Mini, It was dedicated only to M3/M5 cars and spreed across all BMW M variants. It was not working with regular cars.
SpeedActual I'll test with this syntax:
val speedActual = carInfo.cdsData.liveData[CDS.DRIVING.SPEEDACTUAL].map {
it.tryAsJsonPrimitive("speedActual")?.tryAsDouble
}.format("%.0f").addUnit(unitsAverageSpeedLabel)

I pushed up a new build incorporating a bunch of your feedback:
IDrive Version and GPS coordinates are now shown in Car Info, if Advanced Settings is enabled.
GPS Address is shown if known, and is clickable to open any map app.
Added the Acc Battery and Average Consumption 2 values if they look valid.
Fixed the fuel range calculation.
Adds Temperature unit parsing.
The other values (temperatures, parking brake, speed actual vs displayed) would fit better as live gauges, I think.
Check it out and let me know!

I tested this with some extra addition I made yesterday on the way for around 100km. Work without problem.
I'm still fighting against for returning values of driving.mode, driving.parkingBrake, controls.sunroof. Moreover, I'll try to add compass feature based on the gps heading value.
I'll create PR with my changes later this week and after I think we can add it to main, but it's up 2 you.

Feel free to add it in a new tab too, to give the new information lots of room to show off! I imagine this Car Information tab is for more static information and after-parking info, with a separate tab/fragment/viewmodel dedicated to the more dynamic visualizations.

For now the only "real time data" are: actual speed, driving gear, driving mode (ongoing), compass and Engine & oil temp. I moved that info on top of the page.  Data like RPS, Torque, acceleration need to be visualized in some king of  gauges, but I'm unfortunately not gfx designer :(
Below are more static info. I'll share screen later to present what I have.
p.s. Can someone check if that works for You:
1)
val parkingBrake = carInfo.cdsData.liveData[CDS.DRIVING.PARKINGBRAKE].map {
it.tryAsJsonPrimitive("parkingBrake")?.tryAsInt
}

val drivingMode = carInfo.cdsData.liveData[CDS.DRIVING.MODE].map {
val a = it.tryAsJsonObject("mode")?.tryAsJsonPrimitive("mode")?.tryAsInt
val b = it.tryAsJsonPrimitive("mode")?.tryAsInt
"DEBUG: $a - $b"
}

val sunRoof =carInfo.cachedCdsData.liveData[CDS.CONTROLS.SUNROOF].map {
val status = it.tryAsJsonObject("sunroof")?.tryAsJsonPrimitive("status")?.tryAsString?.takeIf { it !="" } ?: " "
val openPosition = it.tryAsJsonObject("sunroof")?.tryAsJsonPrimitive("openPosition")?.tryAsString?.takeIf { it !="" } ?: " "
val tiltPosition = it.tryAsJsonObject("sunroof")?.tryAsJsonPrimitive("tiltPosition")?.tryAsString?.takeIf { it !="" } ?: " "
"DEBUG: Status: $status | Open: $openPosition | Tilt: $tiltPosition"
}

Please share results JsonObject with comment. In my car it returns null always, weird....

Screenshot from the app after my changes:

work ongoing...

Screenshot from the app after my changes:
image

work ongoing...

Thanks, that looks great!
I tested out your code, and it works pretty well for me;

The Sunroof needed me to use tryAsInt instead of tryAsString, and CDS.CONTROLS.SUNROOF needed to be added to the CACHED_KEYS at the top so that the background service knows to load cachedCdsData with that data. The status was 0 when closed, tilt changed to 5 when it was opened (perhaps meaning 5 degrees? I only have a single closed/tilted state, perhaps other cars have multiple tilt positions), and then "open" seemed to indicate how open the roof was, saying 0 when just tilted open and 45 when the roof was as open as it could go in my car.
My parking brake only showed 1, in my current car with an electronic brake, either engaged or disengaged. My dashboard shows a Red PARK word on or off depending on the parking brake, and it has the light to show a Yellow BRAKE word. The car that I captured the data on for the CDS example page had a hand brake and showed 2 at that time. From looking in the BMW Connected app code (in CdsTypes.EParkingBrake2), the values seem related to which brake indicator lights are displayed:
0 - Bremsensymbol_AUS
1 - Bremsensymbol_Gelb
2 - Bremsensymbol_Rot
3 - Bremsemsymbol_Gruen
4 - PARK_Gelb
8 - PARK_Rot
12 - Park_Gruen
16 - AutoP_Gelb
32 - AutoP_Rot
48 - AutoP_Gruen
127 - Unknown
My car shows a driving.mode of 3 (via the second conversion line of your code, without tryAsJsonObject), and didn't change depending on whether I had the car in accessory mode or actually running. It did change for Sport mode (4) and Eco mode (7). The CdsTypes.EVehicleMode shows the following constants:
0 - Initialisierung
1 - Tractionmodus
2 - Komfortmodus
3 - Basismodus
4 - Sportmodus
5 - Sportmodusplus
6 - Racemodus
7 - Ecopro
8 - Ecoproplus
9 - Komfortmoduserweitert
15 - Unknown
My car's JSON looks like this, today:
controls.sunroof = {"sunroof":{"openPosition":0,"tiltPosition":0,"status":0}}
driving.mode = {"mode":3}
driving.parkingBrake = {"parkingBrake":1}

I just pushed up a change to CarInformation to allow the cachedCdsData objects to be updated faster while they are on screen. This has the possibility of confusion, for example the added Sunroof data would work without needing to add it to the CACHED_KEYS, but it would only update the cached value while the Car Info tab is viewed.

In my case the following code:
	val parkingBrake = carInfo.cachedCdsData.liveData[CDS.DRIVING.PARKINGBRAKE].map { 		it.tryAsJsonPrimitive("parkingBrake")?.tryAsInt 	}
cause force close of the app. I sent you report from app.
Short snippet:
java.lang.RuntimeException: Failed to call observer method 	at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:226) .... Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0 at android.content.res.Resources.getText(Resources.java:381) at android.content.res.MiuiResources.getText(MiuiResources.java:97) at android.widget.TextView.setText(TextView.java:6397) at me.hufman.androidautoidrive.databinding.CarDrivingStatsBindingImpl.executeBindings(CarDrivingStatsBindingImpl.java:1398) at androidx.databinding.ViewDataBinding.executeBindingsInternal(ViewDataBinding.java:473) at androidx.databinding.ViewDataBinding.executePendingBindings(ViewDataBinding.java:445) at androidx.databinding.ViewDataBinding$OnStartListener.onStart(ViewDataBinding.java:1687) at java.lang.reflect.Method.invoke(Native Method) at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:216)

Ah ha I've seen that too. By returning an int, Android is trying to load a strings.xml resource by that id. The databinding syntax itself can add a .tostring() in the layout xml, or it could be converted to a double like for the speed, or the LiveData can save the tryAsInt result into a variable and then return it in a wrapping string. The BMW Connected code simply divides the red from the yellow and green categories and returns a boolean that is true for red and false for the rest, which could be a valid approach here too.

This really looks great. Unfortunately, in my ID4 BMW there seems to be a minor glitch.
The fuel range is reported as zero, but in the car data printed below there seems to be the correct value available.
I hope the screenshot makes it clear.

Oh very interesting! I just pushed up a change that I need you to try, which adds another field to that advanced info tab. The sensors.fuel range element seems to include both petrol and battery ranges, and so I have the Fuel Level field programmed to take this sensors.fuel range and subtract any EV battery range. In the new build, can you tell me what your car says for driving.displayRangeElectricVehicle? In my tests, it was 4095 for a missing value, and so I currently ignore values at 4095 or higher, but maybe your car has a different value that I should ignore.

In the new build, can you tell me what your car says for driving.displayRangeElectricVehicle? In my tests, it was 4095 for a missing value, and so I currently ignore values at 4095 or higher, but maybe your car has a different value that I should ignore.

Here it is:
sensors.fuel: {"range":699,"reserve":0,"tanklevel":42}
driving.displayRangeElectricVehicle: 4093

Ok, pushed up that new value, after some ~30 minutes you can download the new build and it should be fixed up. Thanks for testing!

Feel free to test the new version with new real time data. New nightly build will be avaliable tomorrow morning.

@hufman
controls.sunroof: {"openPosition":255,"tiltPosition":255,"status":3}
Full list: stuff.txt

Is your Last Position field blanked out by you, or just empty due to the car not providing it?

Last Position is sometimes filled, sometimes empty, it doesn't depend on the connection to the car. For example, I just entered the app and the field is filled.

Is your Last Position field blanked out by you, or just empty due to the car not providing it?

It depends if advanced settings are enabled.

Interesting! So it only shows your GPS coordinates but not a street or city. I'll push up a build with some more Car Data information soon, can you peek at what the navigation.currentPositionDetailedInfo says for you? Your stuff.txt says map:false and navi:false, I suppose this empty street label could happen if the car doesn't have a map internally to name the location. That would explain the empty field, and I suppose it doesn't look that bad...
Does the little map pin button show you where your car is correctly?

You're right - I don't have navigation in my car, no label navigation.currentPositionDetailedInfo. Gmaps find the car by coordinates.

The new build that just finished should have a fix for the cut-off Compass heading you saw and a new navigation.currentPositionDetailedInfo field. Can you also run the Sentry version to log the crashes you mentioned?

Can you also run the Sentry version to log the crashes you mentioned?

I've done it an hour ago (20:18 GMT+5), the application crashed 3 or 4 times ...
navigation.currentPositionDetailedInfo: null

Hmmm I found one client in the analytics that matched your stuff.txt report, and all it reported were successful connections from a Galaxy S8, no crashes were captured at all =\ Try getting an adb logcat dump to see if that has the error.


Caddyfile fails to load when a hostname is specified

My goal is to host a web service behind tailscale, and leverage tailscale's ability to know which user is connecting as an auth mechanism.
I want my service, running as tailscale device my-node, to be accessible over a custom domain name foo.bar.com (placeholder). Once the node is registered with tailscale, I want to set the DNS A record for foo.bar.com to point at my-node's tailscale IP.
I have the following Caddyfile:
{
    order tailscale_auth after basicauth
}

foo.bar.com:443 {
    bind tailscale/my-node
    tailscale_auth

    respond "Success!"
}

I generated a TS_AUTHKEY and set it in caddy's environment before running caddy run --config /etc/config/Caddyfile. I get the following error:
Error: loading initial config: loading new config: http app module: start: listen udp <IP_ADDRESS>:443: bind: cannot assign requested address

I tried changing bind tailscale/my-node to bind tailscale/ and got:
Error: loading initial config: loading new config: http app module: start: listening on tailscale/:443: missing port in address

The error goes away when I drop foo.bar.com from the route directive.

Is this related to https://github.com/tailscale/caddy-tailscale#https-support ? I am managing my own certs (using a DNS-specific provider challenge) so I am not relying on tailscale's cert issuance.

so, we've changed quite a bit in the plugin since you filed this issue, so I'm wondering if you'd be willing to try again.  I setup a similar config, and ended up getting the error:

Error: loading initial config: loading new config: http app module: start: starting HTTP/3 QUIC listener: listen udp: lookup caddytest: no such host

Disabling HTTP3 solved, so I ended up with a config of:
{
  order tailscale_auth after basicauth
  auto_https off
  servers {
    protocols h1 h2
  }
  tailscale {
    ephemeral
  }
}

caddytest.willnorris.net:443 {
  tls domain.cert.pem private.key.pem
  bind tailscale/caddytest
  tailscale_auth
  templates
  respond `Hello, {{placeholder "http.auth.user.id"}}`
}

Note I'm using static TLS cert files rather than using caddy's https support, though I'm not sure that matters for this.  So if you get a chance, try again and let me know if still run into the same issue.

We've now both fixed our QUIC support and properly hooked into caddy's auto_https feature (see the updated https://github.com/tailscale/caddy-tailscale#https-support), so I think this should work much better now.  Give it a try with the latest version when you can and let me know how it goes.

Will you're crushing it man


sophus: 1.22.10 -> 1.24.6

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/strasdat/Sophus/releases.
meta.description for sophus is: C++ implementation of Lie Groups using Eigen
meta.homepage for sophus is: https://github.com/strasdat/Sophus
Updates performed

Version update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 1.24.6 with grep in /nix/store/dmdkfh2jhq9w1i0cmpip6igmif6dzg20-sophus-1.24.6
found 1.24.6 in filename of file in /nix/store/dmdkfh2jhq9w1i0cmpip6igmif6dzg20-sophus-1.24.6

Rebuild report (if merged into master) (click to expand)

2 total rebuild path(s)

2 package rebuild(s)

First fifty rebuilds by attrpath

sophus

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/dmdkfh2jhq9w1i0cmpip6igmif6dzg20-sophus-1.24.6 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A sophus https://github.com/r-ryantm/nixpkgs/archive/03edcfd04d2334d654d3c3dd5ca7655b4338619f.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/03edcfd04d2334d654d3c3dd5ca7655b4338619f#sophus

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/dmdkfh2jhq9w1i0cmpip6igmif6dzg20-sophus-1.24.6
ls -la /nix/store/dmdkfh2jhq9w1i0cmpip6igmif6dzg20-sophus-1.24.6/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review run on x86_64-linux 1

1 package built:

sophus

Maintainer pings
cc @loco-choco @acowley for testing.

Add a :+1: reaction to pull requests you find important.

LGTM, but I haven't had a chance to test locally yet!

Also LGTM, going to test on some other packages later today.

Tested with a local package of basalt, looks like everything is working fine.


Raise error message when migrations scripts have common version number

WHAT
This PR addresses the issue https://github.com/cloudspannerecosystem/wrench/issues/47.
The bug was that if more migration scripts have the same version number then, instead of reporting this as an issue, wrench pretended as if everything was OK and simply ignored the later migration scripts.
WHY
This bug caused me several hours of bug hunting. I hope with this PR, others will find their bug more easily.
Note: there was another minor issue reported by golangci-lint which I also fixed.

@googlebot I signed it!

@halmai
Sorry for late 🙏 Let me review this in this week end 🙏

@110y
Sorry for late 🙏 Let me review this in this week end 🙏

Is there any progress with this?

@halmai
So sorry for the late 🙏 Let me check...

@halmai Thank you for your contribution!


generate slug with resource name not model name

If you need to generate two resources with the same model, so the result is duplication in the slug for each resource
I know you can override the slug of resources, but I think, it's more efficient to generate correctly at the main function from the first time and leave override to customization only.
so, I created this pull request to generate the default slug with resource name not with model name
so no more needed code for editing the default slug every time.
I think we need to change the getLabel function for the same reason if you accept this pull request.
thanks

Hi, this would be a breaking change, I think?

@danharrin, I don't think that,
as an example, if you have PostResource the old slug was posts and now it also posts
And also this commit passed all tests. so if you have any old links with posts as hardcoded as an example you don't need to change anything.
The only change is the way of generating

Yeah but if someone was using a resource with a different name to the model, their default slug will now change?

Yeah, so for that reason I think this is too risky. But I agree that this does make more sense 👍

@danharrin so it will be in a major version update next time ??!


meta(auth): Enhance tests on authorization

Enhance auth tests in order to be able to add new actions without changing tests.
Helping #2080

@ManyTheFish can you fix clippy please?

bors merge


Dark themed window on light themed macOS should look better

Dark themed window is missing a dark border when macOS theme is set to light. For example Slack have no problem with this despite the fact that it also uses Electron.

(Slack in background)
The VSCode window border should look the same - at the moment it just looks bad. It feels like the window at the borders is losing its "sharpness". Slack shows that it can be achieved. Therefore, please do something about it, because now it looks terrible.

Yes I agree and it is a good chance to change the shadow and stroke in Windows,too.
I will take more details in three hours.

Yes I agree and it is a good chance to change the shadow and stroke in Windows,too.
I will take more details in three hours.

Yes I agree and it is a good chance to change the shadow and stroke in Windows,too.
I will take more details in three hours.

As far as I can tell, we are not setting any border around the window, we just create a frameless window. If someone knows what we do "wrong" or could do better compared to other Electron apps, happy to review a PR.

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!

How to vote for it?

I agree

I Agree

@misolori

agreed

@bpasero it has gotten 20 upvotes！

:slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!

@bpasero @widersky
In Slack, when I set the option to true, the border color changes, but it remains the same when I set it to false.

However, in VsCode, the border color changes no matter what the option is set to. I even tried commenting out the relevant function in VsCode to see if that would fix the issue, but it didn't work. The only thing the option does in VsCode is prevent the theme change, but the native window borders and other elements such as the traffic lights still change.
https://github.com/microsoft/vscode/blob/5e00b5b7da6bafe58b6fb1f7979927773a4979ab/src/vs/platform/theme/electron-main/themeMainService.ts#L51-L54

Dark themed window is missing a dark border when macOS theme is set to light. For example Slack have no problem with this despite the fact that it also uses Electron.

(Slack in background)
The VSCode window border should look the same - at the moment it just looks bad. It feels like the window at the borders is losing its "sharpness". Slack shows that it can be achieved. Therefore, please do something about it, because now it looks terrible.

Any updates?

@jhaemin So far from what I see the task is still up for grabs, so this feature hasn't been implemented yet.

/duplicate https://github.com/microsoft/vscode/issues/120420

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.
Happy Coding!

https://github.com/microsoft/vscode/issues/157491#issuecomment-1840091276

@VSCodeTriageBot, you closed this as a duplicate, yet didn't link its replacer? That's just abusurd.


Add test images for tests in test_onnxruntime.py.

Instead of downloading test images from URLs, we're moving test images to this repo to prevent future broken links.

Thanks @josephevans !


Stack Overflow in forge test

Component
Forge
Have you ensured that all of these are up to date?

[X] Foundry
[x] Foundryup

What version of Foundry are you on?
forge 0.2.0 (9b2d95d 2022-06-23T00:22:22.617534Z)
What command(s) is the bug in?
forge test
Operating System
macOS (Apple Silicon)
Describe the bug
It seems our test suite has just reach some threshold that causes a stack overflow.
Repro steps:
(I tested these on a fresh clone)
git clone https://github.com/ethereum-optimism/optimism
cd optimism/packages/contracts-bedrock
yarn         # to install contract deps
forge test   # this will work fine

git checkout 093244521b1f0f9489cd573ad66c3c317d7ecea4
forge test

The output of the final test on will terminate with:

thread '<unknown>' has overflowed its stack
fatal runtime error: stack overflow
[1]    62889 abort      forge test

The same bug is visible in this CI output: https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/3503/workflows/19bb9e25-731e-4dcf-9fc2-9edfb8b928a7/jobs/45876/parallel-runs/0/steps/0-105

git checkout 093244521b1f0f9489cd573ad66c3c317d7ecea4
gives me
fatal: reference is not a tree: 093244521b1f0f9489cd573ad66c3c317d7ecea4
fwiw I couldn't reproduce this with forge 0.2.0 (d89f6af 2022-06-24T00 on this PR https://github.com/ethereum-optimism/optimism/pull/2825

Ahh, sorry about that, I'd overwritten that commit.
Try git pull https://github.com/maurelian/optimism-1 forge-overflow-repro then forge test in the same dir.
As you'll notice, something about how I refactored the tests seems to have resolved it. I think I might have reduced the depth of inheritance in the refactoring, honestly it's not 100% clear to me.
Another observation, is that smaller subsets of the tests work fine. Before refactoring the tests, we had planned to workaround it by looping over the test files as you can see here: https://github.com/ethereum-optimism/optimism/commit/bb8cdf2f3ecce1456c01e668f36b1429e02934d1#diff-8867d60c5856f3dd26f4c8e44f748fc94cb23bedf280def40159d6977153456b

@onbjerg couldn't figure this one out,
apparently this is caused by the second prank in the setup function, which then triggers a loop where the proxy either calls itself or the proxy which triggers a fallback.
couldn't fully make sense of how the pranks are (re)set tbh

@maurelian could you perhaps describe how the proxy setup is supposed to work?
from what I've gathered,

the L2OutputOracle is created
create a proxy and set the oracle as implementation
set the oracle to L2OutputOracle(proxy)
create another proxy and set its implementation to L2OutputOracle(proxy)

so now we have
proxy -> proxy -> oracle
right?
I believe due to the second prank we end up in a loop that's either
proxy <-> proxy
or
proxy that calls itself, perhaps due to proxyCallIfNotAdmin

I don't entirely follow either, would be nice with an overview of how this is supposed to work

I don't think this is a bug on our end, forgive me if I misunderstand:
In L2OutputOracle_Initializer::setUp you create a proxy that delegates to L2OutputOracle (the address of which is stored in oracleImpl. Let's call this Proxy 1. The address of this proxy is then stored in oracle.
In L2OutputOracleUpgradeable_Test::setUp you set oracleImpl = oracle and then you call some init function on a new Proxy (let's call it Proxy 2). Proxy 2 delegates to Proxy 1.
So by my understanding, the call to Proxy 2 will delegatecall into the code of Proxy 1. Proxy 1's code will just execute the fallback function which looks up it's implementation using the storage of Proxy 2. The implementation noted in the storage of Proxy 2 is Proxy 1, so this delegatecall will delegatecall into Proxy 1. The same happens, and it loops.
So I don't think this is because of prank or Forge, I think it's because of https://github.com/maurelian/optimism-1/blob/093244521b1f0f9489cd573ad66c3c317d7ecea4/packages/contracts-bedrock/contracts/test/L2OutputOracle.t.sol#L347?
I hope that made some sense.

@mattsse  you're right it looks like an infinite recursion where proxy1 delegatecalls proxy2 over and over.
So yeah, my bug there, and it explains why the refactor fixed it. But shouldn't it lead to an OOG, or is there no gas limit in the tests?

The gas limit is super high, AFAIK it's like 2^32 by default or something, so we simply just hit stack overflow before we run out of gas

let's add a recursion check + warning

Hmmm, OK.
Is it possible to catch the overflow and give a warning about a possible infinite loop in the contract's control flow?
Otherwise there's probably not much to be done here.

let's add a recursion check + warning

where would we add this? this seems like it'd require static analysis

if there's a loop then we'll end up in a loop where Backend::call is called until the stack overflows, this happens at around ~120 depth in this case.
I think we could check this with an inspector that keeps track of entered calls, exited calls etc. but perhaps not worth it

Yeah - feels lower prio. Let's keep open for visibility anyway

Since this issue was opened, recursion was removed from the EVM implementation (revm), and gas limit is configurable with --gas-limit.


A callback for when the global connection is dis/established

Is your feature request related to a problem? Please describe.
I'd like to indicate to the user when the WebSocket connection goes down (and also prevent some actions).
Describe the solution you'd like
I'd imagine being able to specify the callbacks (connect and disconnect) in the configuration object?
Describe alternatives you've considered
There doesn't seem to be any other way to detect the initial connection that I can see :)

Looking closer, I don't think action_cable provides any transparency into the overall connection, only to individual subscription connections. A bit of a shame, but nevermind.
I suppose one could use a kind of dummy global subscription and use the callbacks in that.

Yes. It's why I went with Node.js & socket.io for a Websocket implementation where I needed to be aware of client or server disconnection.


Test OXM TCP/UDP port with masks

https://mail.openvswitch.org/pipermail/ovs-discuss/2015-January/036162.html
Ben Pfaff blp at nicira.com
Thu Jan 22 16:54:38 UTC 2015
Previous message: [ovs-discuss] Flow Matching with port ranges..
Next message: [ovs-discuss] ovs installation - debian
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Jan 22, 2015 at 05:34:15PM +0530, nitish nagesh wrote:

I am trying to add L4 port range matching capability to our switch
(internally uses OVS code). I have used experimenter match fields in the
Flow Mod to get these. Once i receive them, after parsing the experimenter
OXM's, i store them in the "flow" structure. I have added new fields to
store them, something like this:
struct flow {
.
.
.
struct port_range pr;
.
.
};
struct port_range
{
ovs_be16 begin;
ovs_be16 end;
};
Note that when i receive a port range in the flow-mod, i would NOT
populate the tp_src or tp_dst fields.
However i am facing issues when it comes to matching packets to this rule.
As my understanding goes, OVS creates a hash of all the field values in the
"flow" structure as received in the flow-mod and stores them in the
classifier. A network packet would never match this rule, as it doesnt have
a port-range and hence the hash would always fail.
I was thinking if there's an easy way to achieve this with minimal
changes to the code. My knowledge about OVS code is limited, hence
requesting for help. Please comment.

Implementing port ranges this way is kind of an uphill battle.  I'd
suggest using multiple flows that bitwise match on the tp_src or tp_dst
fields, as described in ovs-ofctl(8):
   tcp_src=port/mask
   tcp_dst=port/mask
   udp_src=port/mask
   udp_dst=port/mask
   sctp_src=port/mask
   sctp_dst=port/mask
          Bitwise  match  on  TCP  (or  UDP or SCTP) source or destination
          port.  The port and mask are 16-bit numbers written  in  decimal
          or  in  hexadecimal prefixed by 0x.  Each 1-bit in mask requires
          that the corresponding bit in port must match.   Each  0-bit  in
          mask causes the corresponding bit to be ignored.

          Bitwise  matches  on transport ports are rarely useful in isola‐
          tion, but a group of them can be used to reduce  the  number  of
          flows  required  to  match  on  a range of transport ports.  For
          example, suppose that the goal is to match TCP source ports 1000
          to  1999,  inclusive.   One way is to insert 1000 flows, each of
          which matches on a single source port.  Another way is  to  look
          at the binary representations of 1000 and 1999, as follows:
<PHONE_NUMBER>0
<PHONE_NUMBER>1
          and  then  to  transform  those into a series of bitwise matches
          that accomplish the same results:
          01111101xxx
          0111111xxxx
          10xxxxxxxxx
          110xxxxxxxx
          1110xxxxxxx
          11110xxxxxx
          1111100xxxx
          which become the following when written in the  syntax  required
          by ovs-ofctl:
          tcp,tcp_src=0x03e8/0xfff8
          tcp,tcp_src=0x03f0/0xfff0
          tcp,tcp_src=0x0400/0xfe00
          tcp,tcp_src=0x0600/0xff00
          tcp,tcp_src=0x0700/0xff80
          tcp,tcp_src=0x0780/0xffc0
          tcp,tcp_src=0x07c0/0xfff0

          Only  Open  vSwitch  1.6  and later supports bitwise matching on
          transport ports.

          Like the exact-match forms described above,  the  bitwise  match
          forms apply only when dl_type and nw_proto specify TCP or UDP or
          SCTP.

https://github.com/REANNZ/faucet/pull/832


VS Code consumes too much RAM

Issue Type: Bug
I've checked many similar issueson GitHub and StackOverflow, before I decided to submit mine. My issue is reproducible in both the stable and insider's version of VS Code. Extensions are disabled.
Within an hour or so VS Code starts consuming over 10GB of RAM. Closing it, frees up the memory immediately. If I miss the point, when the RAM consumption is too high, the OS hangs and I'm left with nothing but to hard reset the computer.
I'm attaching the result of code --status at the bottom.
VS Code version: Code 1.47.1 (485c41f9460bdb830c4da12c102daff275415b53, 2020-07-13T22:43:02.577Z)
OS version: Darwin x64 19.3.0

System Info

Item
Value

CPUs
Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (6 x 3697)

GPU Status
2d_canvas: enabledflash_3d: enabledflash_stage3d: enabledflash_stage3d_baseline: enabledgpu_compositing: enabledmetal: disabled_offmultiple_raster_threads: enabled_onoop_rasterization: disabled_offprotected_video_decode: unavailable_offrasterization: enabledskia_renderer: disabled_off_okvideo_decode: enabledviz_display_compositor: enabled_onviz_hit_test_surface_layer: disabled_off_okwebgl: enabledwebgl2: enabled

Load (avg)
3, 2, 2

Memory (System)
32.00GB (4.92GB free)

Process Argv

Screen Reader
no

VM
0%

Extensions (1)

Extension
Author (truncated)
Version

vsliveshare
ms-
1.0.2619

Version:          Code 1.47.1 (485c41f9460bdb830c4da12c102daff275415b53, 2020-07-13T22:43:02.577Z)
OS Version:       Darwin x64 19.3.0
CPUs:             Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (6 x 3697)
Memory (System):  32.00GB (5.00GB free)
Load (avg):       2, 2, 2
VM:               0%
Screen Reader:    no
Process Argv:
GPU Status:       2d_canvas:                     enabled
                  flash_3d:                      enabled
                  flash_stage3d:                 enabled
                  flash_stage3d_baseline:        enabled
                  gpu_compositing:               enabled
                  metal:                         disabled_off
                  multiple_raster_threads:       enabled_on
                  oop_rasterization:             disabled_off
                  protected_video_decode:        unavailable_off
                  rasterization:                 enabled
                  skia_renderer:                 disabled_off_ok
                  video_decode:                  enabled
                  viz_display_compositor:        enabled_on
                  viz_hit_test_surface_layer:    disabled_off_ok
                  webgl:                         enabled
                  webgl2:                        enabled

CPU %	Mem MB	   PID	Process
    0	   131	   777	code main
    0	    98	   778	   gpu-process
    0	    33	   781	   utility
    0	   131	  1225	   shared-process
    0	     0	  5025	     /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0	   754	  1268	   window (ValidationButtonRow.stories.tsx — wecancomply)
    0	     0	  1269	     /bin/zsh -l
    0	    33	  4396	       npm
    0	     0	  4397	         sh -c cd ./common && start-storybook -p 9009
    0	   819	  4398	           node /Volumes/Shared/work/wecancomply/node_modules/.bin/start-storybook -p 9009
    0	   754	  1272	     extensionHost
    0	   164	  1716	       electron_node tsserver.js
    0	  3244	  1717	       electron_node tsserver.js
    0	    66	  1735	         electron_node typingsInstaller.js typesMap.js
    0	  3178	  1718	       electron_node tsserver.js
    0	    33	  1809	       /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer) /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=1272
    0	    66	  3006	       /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer) /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/css-language-features/server/dist/node/cssServerMain --node-ipc --clientProcessId=1272
    0	    98	  3018	       /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Renderer).app/Contents/MacOS/Code Helper (Renderer) /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/html-language-features/server/dist/node/htmlServerMain --node-ipc --clientProcessId=1272
    0	    33	  1525	     watcherService
    0	     0	  2314	     /bin/zsh -l
    0	    33	  2771	       npm
    0	     0	  2772	         sh -c cd ./client_eam && react-app-rewired start
    0	    33	  2773	           node /Volumes/Shared/work/wecancomply/node_modules/.bin/react-app-rewired start
    0	   426	  2774	             node /Volumes/Shared/work/wecancomply/node_modules/react-app-rewired/scripts/start.js
    5	   754	  2775	               /Users/naz/.nvm/versions/node/v12.16.1/bin/node --max-old-space-size=2048 /Volumes/Shared/work/wecancomply/node_modules/fork-ts-checker-webpack-plugin/lib/service.js
    0	    66	  2840	     searchService

Workspace Stats:
|  Window (ValidationButtonRow.stories.tsx — wecancomply)
|    Folder (wecancomply): 809 files
|      File types: ts(233) tsx(103) scss(88) js(50) svg(46) map(43) json(18)
|                  png(7) id(4) otf(4)
|      Conf files: package.json(3) tsconfig.json(3) tslint.json(3)

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

@mjbvz , yes, just as I mentioned in the issue in the second sentence. Closing VS Code instantly frees up 8-12GBs of RAM both in insider's build and in stable version (with extensions disabled)

Have you enabled project wide error reporting for JavaScript and TypeScript? Also, can you share your project?

No, it's disabled. Should I enable it? The project is in the private repo, so, unfortunately, I can't share it. However, I should mention this happens in all projects in my case.

This happens also on my Ubuntu machine, as well as on Mac OS.

It's odd that you have two  tsserver.js instances with high memory usage running. There should only be one high memory instance unless you've configured project wide error reporting.
If you can't share the projects, can you try collecting the TS Server log:

Set "typescript.tsserver.log": "verbose",
Restart VS Code and reproduce the problem
In VS Code, run the TypeScript: Open TS Server log command
This should open a large log file called tsserver.log

If you can share the log, we can take a look to see if anything stands out

⚠Warning: The TypeScript log may include information from your workspace, including file paths and source code. If you have any concerns about posting this publicly on Github, just let me know and we can arrange something else. On our side, we only use these logs to investigate issues like this

Should I do that in the Insider's version of VS code or the stable one?

@mjbvz , can I send the log privately (not in this issue)?

@mjbvz ?

With the insiders. You can email the logs to matb at microsoft. Thanks

Hi Matt. I sent the email. The logs were getting huge... Over 5GB and kept increasing in size.
A bit more info: I worked in Insider's build for about 2 hours or so, with all extensions disabled and when I decided to generate logs, VS Code was consuming around 8GB of RAM (8GB used RAM before VS Code => 16GB during use). When I started generating logs, RAM consumption increased by another 8GB (8GB before VS Code => 24GB after generating logs).
I'm not generating logs anymore, but still 24GB of RAM is used.
After quitting VS Code, the amount of Used RAM dropped to 12GB, meaning VS Code consumed about 12GB.

I've just checked the log file, it again doubled in size: the one I sent you is around 450MB, currently the same file in the original directory is 870MB. Something crazy is going on.


Lavalink v3.1 Compatibility & Resolving issues with voice events

Changes:

Added PlayerStatusUpdateEvent sent every time lavalink sends an update. Possible use (well I'm using it) if someone were to make a web player, it's nice to have an update event to send to a web player WebSocket.
Made AudioTrack more pythonic, removed that nasty () from building, now it's AudioTrack.build(...)
Made ll.py compatible with lavalink server v3.1, by first trying to connect to a rest_port, if it fails, try ws_port if even that fails, throw an error (as previously).
Added WebSocketClosedEvent for v3.1 compatibility, I don't know what else to do with it, because I haven't encountered it in the wild yet.
Improved manage_failover, so we don't have to disconnect and then re-connect. Handover is now smooth AF.
Added some magic and pixie dust to on_socket_response, so changes to voice WebSockets are auto-magically resolved. Jokes aside, I've added a dictionary that stores full voice event updates and state changes, on the guild by guild basis.

BIG BOYE PYLINT: click here, CLICK IT

Perhaps the websocket disconnect event could be renamed to node disconnect?

Which event are you referring to? WebSocketClosedEvent? In that case, I'd rather say, that the name is confusing since it's called when lavalink loses ws connection to discord.

Ah, thought it was something else. WebsocketClosed is equally confusing IMO (as proven above haha)

Okay, I'll change the name to VoiceWebSocketClosedEvent : ^) as soon as I get back.

:^)
make sure to lint

making Devoxin happy uwu
-- flake8 test --
c:\python37\lib\site-packages\pycodestyle.py:113: FutureWarning: Possible nested set at position 1
  EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')

OK
-- pylint test --

OK

lint? 👀

Obligatory pylint meme:
-- flake8 test --
c:\python37\lib\site-packages\pycodestyle.py:113: FutureWarning: Possible nested set at position 1
  EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')

OK
-- pylint test --

OK


Translator badge request

I request a translator badge!
I did the Japanese translation prior to release.
orange / U-orange

Added! Thank you for helping to translate!


Conditional type is deferred because narrow-as-assertion on constrained type parameter has no effect

Sorry for the gratuitous title.
Code
type IsString<X> = [X] extends [string] ? true : false

function isString<X extends string, Y>(x: X, y: Y)  {
    if (typeof x === "string") {
        const a: IsString<typeof x> = true; // error: conditional type is deferred
    }
    if (typeof y === "string") {
        const b: IsString<typeof y> = true;
    }
}

Expected behavior:
The two to behave the same; probably, they should both be OK.
Actual behavior:
The type of x does not get narrowed by assertion, presumably because the assertion adds no information. Conditional type resolution ignores parameter constraints when attempting to resolve using the most restrictive instantiation, and therefore IsString<typeof x> does not resolve.
Essentially T extends string, and T & string where T is unconstrained, do not behave the same in conditional check types. The former has its constraint ignored, while the latter gets to use its intersection proof.
Playground Link:  link
Related Issues:

I understand why type parameter constraints are ignored by the restrictive instantiation. Using transitive reasoning with any breaks a whole load of things, as shown from the example in checker.ts.
type Foo<T extends { x: any }> = T extends { x: string } ? string : number

A question I have is: are there other examples that do not involve any, where ignoring constraints is necessary? I can think of another one:
type Bar<T extends Object> = T extends object ? string : number

Would it be fair to say that the restrictive instantiation is currently necessary purely because conditional type resolution uses assignability, a non-transitive relation?
I know that definitelyAssignable was a thing at one point; was that crafted with the intent to be a transitive type relation?

I think I know enough about this now to say that it's a design limitation.

It is correct that a type parameter T extends string does not get narrowed to T & string upon typeof because the intersection adds no information: the type parameter is already a subtype of string.
The only other vector of change would be to consider constraints in conditional types but there are multiple reasons why this is difficult (and incorrect in some cases).

This leads me to the conclusion that this is just an awkward composition of concepts, but one that few people seem to face.

I think I know enough about this now to say that it's a design limitation.
* It is correct that a type parameter `T extends string` does not get narrowed to `T & string` upon `typeof` because the intersection adds no information: the type parameter is already a subtype of `string`.

* The only other vector of change would be to consider constraints in conditional types but there are multiple reasons why this is difficult (and incorrect in some cases).

This leads me to the conclusion that this is just an awkward composition of concepts, but one that few people seem to face.

@jack-williams Would be really great to learn something here. Currently I'm trying to use a conditional type as return type of a function. Inside the function I'm narrowing down on the constraints of the conditional type to return the corresponding value (similar to this SO post.
As I read your posts here I'm wondering about the square bracket notation in your IsString type. What does it do?
And you wrote considering constraints in conditional types would sometimes be incorrect. I assume this is the reason why writing a function with conditional return type is not possible. Right? And could you explain why?


[BUG] "| size" doesnt get applied to WIKI links with relative path

When an image link has a path like:
![[../assets/where which.png]]
or
![[../assets/where which.png|300]] etc. ,
on resizing by dragging the edge of the image, or even when using Shift + Scrollwheel, the link (number part) doesnt get changed to reflect the new sizes.
But when using just the name of the image, it works fine, like:
![[where which.png]]
or
![[where which.png|300]] etc.
This issue does not exist when copy pasting an image into a note as the name in the link will just have the image's filename, but when manually entering a link with a chord like: ![[whe<Enter>, it gets changed to ![[../assets/where which.png]] with an entire filepath, by default, forcing me to manually remove the path so that resizing works.

Fixed in 1.2.0 also related to https://github.com/xRyul/obsidian-image-converter/issues/36
Latest release adds better support for MD and WIKI links. Which in essence also adds better support for relative paths, either with "./" "../" or without. So now it is possible to resize either via drag resize or scrollwheel +mod key
BTW how did you add ../ to those WIKI links?

I either type them in manually or as per my usual workflow, Obsidian auto-inserts it for me as I’ve described. This particular example is from a note inside a folder in the vault.


Need Bulk Compression

Clearly Squoosh is a  wonderfull Project,
But it hasnt any bulk optimization feature,
The clear points are
1.Need user-customized settings for default operation, and then bulk compression output.

Working on that. Also duplicate of #301


vim_strcat: Allow overlap in both branches.

The "true" case in vim_strcat uses mch_memmove which supports overlapped pointers, but the "false" case uses strcpy, which does not. Use mch_memmove in both cases.

Thanks.  Was this breaking anything?

On Jan 27, 2017 21:53, "Bram Moolenaar"<EMAIL_ADDRESS>wrote:

Thanks. Was this breaking anything?

Not that I am aware of. I thought I would leave it up for debate :)

Justin M. Keyes


Raises exception when record not found

This fixes #23

Looks good to me. Left one small suggestion. And looks like it is time for me to use formatter too.

Done :+1:

Thanks!


Feedback dev

Integrating a % based feedback on the status of staging from tape to disk for data access.

Linking in the % based feedback for users to have warm fuzzy feelings.


[Improve][Connector][Nebula] Update the version of nebula client to '3.3.0'

Update the version of nebula client to '3.3.0'

Purpose of this pull request

Which issue you fix
Fixes # (issue).
Checklist:

[ ] I have executed the 'mvn spotless:apply' command to format my code.
[ ] I have a meaningful commit message (including the issue id, the template of commit message is '[label-type-#issue-id][fixed-module] a meaningful commit message.')
[ ] I have performed a self-review of my own code.
[ ] I have commented my code, particularly in hard-to-understand areas.
[ ] I have made corresponding changes to the documentation.
[ ] I have added tests that prove my fix is effective or that my feature works.
[ ] New and existing unit tests pass locally with my changes.
[ ] I have checked my code and corrected any misspellings.
[ ] My commit is only one. (If there are multiple commits, you can use 'git squash' to compress multiple commits into one.)

the version of nebula client 3.3.0 dose not work well ,because the class HostAddress did not implements Serializable yet

But if don't use 3.3.0, the 'mvn package' would fail, and the class of 'com.vesoft.nebula.client' would not be found.

com.vesoft.nebula.client

you mean 'com.vesoft.nebula.client' package would import failed?
i had add the repository of nebula in the pom file:

snapshots
https://oss.sonatype.org/content/repositories/snapshots/

But if don't use 3.3.0, the 'mvn package' would fail, and the class of 'com.vesoft.nebula.client' would not be found.

can you visit this address:
https://oss.sonatype.org/#nexus-search;gav~com.vesoft~client~~~~kw,versionexpand

Yes, I can visit this address and find the client of version 3.0-snapshot, but my maven can not find it.

Yes, I can visit this address and find the client of version 3.0-snapshot, but my maven can not find it.

have you tried add the repository to the settings.xml file


Hash the generated logs to avoid any tampering with the results.

Create a hash by every log file generated by a test (in the VPS instance or in the local machine) to avoid any tampering with the results. Download both the hash and the log in the same step.
Use a common but secure hash algorithm to perform the checksums easily by anyone.

I've implemented this in #37 , however someone could still mess with the logfiles, recalculate the hashes, change the hash files, before uploading the results. I don't really see a way around that, though.


Accept native Kubernetes manifests as configuration files

Currently, we require the configuration supplied to dm to be in the dm configuration format (i.e., a list of resources, each of which has a name, a type and a list of parameters), and we throw an unmarshalling error if it isn't. In order to integrate with helm, or just to support a simpler experiences, dm should accept a flat list of native Kubernetes manifests as an alternative form of configuration.

Added support for this in #166


conflicts in versions of package

Hello,
I try to use biasfinder and there is an conflicts of versions between spacy, neuralcoref and en_core_web_lg
For running neuralcoref, it requires spacy v2.x.x, not v3.x.x
However, loading en_core_web_lg, it is incompatible with the spacy v2.x.x, but requires spacy v3.5.
To use both en_core_web_lg and neuralcoref, there is conflicts between them.
I would like to respecfully ask for the suggestion to resolve the conflict.
I would appreciate if you could help me with it.

Hi @jasonlee27,
Thank you for raising the issue.
If I'm not mistaken, installing neuralcoref directly using PyPI will not work.
Please install neuralcoref from the source by following the instruction in their github repository:
Install NeuralCoref from source
venv .env
source .env/bin/activate
git clone https://github.com/huggingface/neuralcoref.git
cd neuralcoref
pip install -r requirements.txt
pip install -e .

Please let me know if you still facing the conflict of versions issue after performing the procedure above :)
Many thanks,
Hilmi

Hello , i tried this also but still same issue persist.
Kindly can you provide how you implemented it if you faced issue or how to deal with this ?


Filter test names in run_standalone_tests.sh when checking for errors

Description & Motivation
The run_standalone_tests.sh scripts runs the tests and then checks the output log for keywords such as "error", "exception", "failed", etc.
https://github.com/Lightning-AI/lightning/blob/dd206a20d8cbe037912c144fc3c5e5306ac0d77e/tests/tests_pytorch/run_standalone_tests.sh#L54
It includes an extra rule to avoid false positives on keywords like "xfailed" or "on_exception" (which is a hook name). However, more false-positives can occur if the name of the tests includes one of the keywords. For example, if we have a test called

@RunIf(standalone=True)
def test_for_an_exception_bla_bla():
 ...

Pitch
In the check here
https://github.com/Lightning-AI/lightning/blob/dd206a20d8cbe037912c144fc3c5e5306ac0d77e/tests/tests_pytorch/run_standalone_tests.sh#L54
also exclude all test names that we ran. We have access to the list since we collect all parameterizations.
Alternatives
No response
Additional context
No response
cc @carmocca

Good idea. In the meantime, I recommend using "raises" instead of "exception" in test names

Do you have an example of what output is in the standalone_test_output.txt? @awaelchli
If its just the test names we need to exclude, I think adding this should work
 | grep -qvF ${parametrizations_arr[@]/#/-e } # https://stackoverflow.com/a/2300653

so the check becomes
if grep -iE 'error|exception|traceback|failed' standalone_test_output.txt | grep -vE 'on_exception|xfailed' | grep -qvF ${parametrizations_arr[@]/#/-e }; then # https://stackoverflow.com/a/2300653

@ryan597 Yes if this works I think that's what we were looking for :))
The output log looks something like this (an excerpt):
============================= test session starts ==============================
collecting ... ============================= test session starts ==============================
collecting ... ============================= test session starts ==============================
collecting ... ============================= test session starts ==============================
collecting ... collected 1 item

strategies/test_ddp.py::test_ddp_grad_clipping[val-cpu-bf16-mixed] collected 1 item

strategies/test_ddp.py::test_ddp_grad_clipping[val-cuda-32-true] collected 1 item

strategies/test_ddp.py::test_ddp_grad_clipping[norm-cuda-16-mixed] ============================= test session starts ==============================
collecting ... ============================= test session starts ==============================
collecting ... Initializing distributed: GLOBAL_RANK: 1, MEMBER: 2/2
collected 1 item

strategies/test_ddp.py::test_ddp_grad_clipping[norm-cuda-32-true] ----------------------------------------------------------------------------------------------------
distributed_backend=gloo
All distributed processes registered. Starting with 2 processes
----------------------------------------------------------------------------------------------------

Initializing distributed: GLOBAL_RANK: 1, MEMBER: 2/2
Initializing distributed: GLOBAL_RANK: 1, MEMBER: 2/2
----------------------------------------------------------------------------------------------------
distributed_backend=nccl
All distributed processes registered. Starting with 2 processes
---------------------------------------------------------------------

Our heuristic to detect exceptions being printed in this output text is to grep for keywords like "error", "exception" etc. The reason why we want to exclude the test names is because a test could be named like
def test_some_function_raises_error():
     ...

but would lead to a false-positive detection since the test names are printed in the output log as shown above.


added proper null safety and added capture parameters

@all-contributors please add @Imgkl as Code
@all-contributors please add @Imgkl as Maintenance
@all-contributors please add @Imgkl as Documentation


Add routes on client

Currently we can have 3 main interfaces (home, create story, story/room). We should put these interfaces into separated routes (can use react-router). This will help us:

Easy for contributors to work on each interface
Easy to add new interfaces/features if needed (say we want to add an About page, we just need to put another route in)
Customize shared components if needed (say we want several interfaces to share the same action bar)

If this suggestion is approved, I'd like to work on this.

Hey @pynnl! Love the initiative you took to open this! react-router will be our best bet as a solution for this enhancement.
What are the routes that you think we should introduce? Maybe something like:

/login
/contact
* (404 not found route
/rooms - to browse all rooms
/rooms/:roomID - to join an existing room

These are just thoughts off the top of my head which might not reflect the logic we're looking to add - comments/suggestions welcome!

Nice list @SeanPrashad. I suggest few points:

I believe we should have a complete app with anonymous support fist. Once we have a smooth release, we can upgrade more features like  login and register (only a few weeks left til the course ends). So for now we can add /login and /register routes as placeholders and leave them there for future works.
In the prototypes, homepage UI contains Join Story and Create Story, so I think we don't need a separated route /rooms. In fact for an online gaming web app, the homepage should not be an introduction page, but a menu-game UI so players can start the game immediately. Some good examples are agar or zombs.

+1 to supporting anonymous to get you started.  Doing the whole login/register/account dance is going to slow you down, since it opens up a ton of extra "must haves" before you have something people will use.
Start with the most basic thing to test the core of your app, which is collaborating on a story, not managing users.  Layer that stuff in once you have your foundation.

Great! Feel free to get a WIP PR up and going when you have time @pynnl


Use GitHub Actions to test K on MacOS instead of Anka

While Anka has served us very well as a way of having access to different versions of MacOS for testing purposes, it has been rather unreliable for us when used for CI. We don't use GitHub Actions for CI more broadly because we want more parallelism in our machines for the most part. However, we were not using a particularly beefy machine to test on MacOS previously, so using GitHub actions would not be any slower than Anka, overall. Since this is a public repository, we also don't have to worry about paying for a certain number of minutes; GitHub actions does have intrinsic limits, but we are likely well below those and below them, the service is free.
As such, it seemed appropriate to remove our dependence on Anka and make it so that our CI tests K on MacOS using GitHub Actions. This was possible via the following changes:

The Deploy phase of the Jenkinsfile now creates a prerelease rather than a full release. I would have preferred to use a draft release, but GitHub actions does not allow you to trigger workflows when a draft release is created for some inexplicable reason.
When a prerelease is created, we kick off a GitHub workflow which builds the homebrew bottle on MacOS and then tests it locally on a clean environment. If the tests pass, it attaches the bottle to the release, pushes the changes to the homebrew formula to the homebrew-k repo, and marks the release as no longer being a prerelease.

I have not actually tested the "push changes to homebrew-k" or "mark release as final" phases of the workflow yet, as it is impossible to do so without potentially disrupting the user experience. Particular care should be spent reviewing these sections, and when this is merged, I will monitor closely and push additional fixes if necessary in order to address any issues that arise.
Here is evidence that the rest of the workflow passed: https://github.com/kframework/k/actions/runs/1440945977

I think this looks good but I don't have a lot of experience with CI and home brew either...


fixup! ispc nmodl constants

Fix  issue #433

Constants were hard-coded so no custom constants, no
unit changes, no double_to_string handling

I leave to double_to_string to handle how to chop doubles

Ok, I will wait for another PR to solve the issue and rebase this


[PTS] GATT/CL/GAW/BV-02-C fails with INCONC

Test Env:
Zephyr Revision: master/c968e102e679f41f0fd2016fea7391f4c121a320
PTS: 7.1.1
Host: Win 10 64 bit Enterprise, with Intel® Core i5-6300U CPU @2.40GHz, 8 GB RAM
BT USB Dongle: PTS Dongle
Client: Arduino 101 flashed with current Zephyr Revision
Attached log below.

autoptsclient-zephyr.log

This is PTS issue. We have reported this here. It is in resolved state now, you can test your solution with ETS attached there.

@MariuszSkamra Okay, thank you for the info. Do you have the link to the list of issues that have been reported such as this? I have few more, thought I could raise. Would like to check if they have already been reported.

@MariuszSkamra found the place, I will raise the other PTS issues where you have raised ones such as these before.


Migration to Swift 4

Hello. I updated some of the codes and migrated them via Xcode 9.
Some other changes are:

Applied Xcode's recommended  settings for pbxproj migration.
Updated Sample Project's code and IBOutlets with it.
Updated Sample Project's sample Youtube Video IDs shown.

Resolves:

#138

Closed via #143. Please open another PR if this addressed anything else. Thanks! Sorry for the delay.


Add to documentation

I have a rough version of the documentation that I am working on here. We need to translate this into HTML to add to the docs at docs/index.html.

Hi @hrushikeshrv
I’d love to have a go at this..

Great! Currently the docs are structured by section. There is one section tag for each section of the docs (like Installing, Usage, Examples, etc.), and sections like API, Customizing, and Contributing are yet to be translated to HTML. I will be adding to the rough version of the docs (in the Google Doc) in a few hours, then you could follow the same structure that index.html has to translate from Docs to HTML.
The API section will have 3 sub sections which you could divide however you would like. If you want, you could come up with your own structure for index.html and use that too, if you want to present the page differently than the simple HTML used currently. The stylesheet linked has a few helper classes and variables that could be useful.
Finally, if you could add syntax highlighting to the code examples, that would be great too, but that would probably require a significant chunk of work. Feel free to ask any questions you have :)

Hi @hrushikeshrv, I've checked the document and you haven't made the addition. Please let me know when you do this.

I've added a section right now. I'm holding off for Hacktoberfest to actually start in a few days :)

Hi @hrushikeshrv ,
Please let me know when the addition is made to a good extent

Hi @hrushikeshrv, I see you've made additions to the doc. Do you think they're ready to go??

Yes, the API section is complete. You can add that to the docs. I will be completing the last two sections in the next couple of days.

Hi @hrushikeshrv I was wondering if this part of the doc is an image

e

It's a diagram that I have inserted, but if you click on edit -> actions, you can download it as an svg

I think I need to have access to do that.

@hrushikeshrv I still can't download it💀

I've sent you an email with the SVG file for it. Let me know it that works for you :)

Thank you


Add DiT inference script

This PR aims to add an inference script for DiT object detection.
=> however, the script doesn't work right now, I'm able to load all weights into the model and run a forward pass (have some questions).
It can be run as follows (after pip installing Detectron2 and timm in Colab):
!python /content/unilm/dit/object_detection/inference.py \
--input /content/publaynet_example.jpeg \
--output /content/output \
--config /content/unilm/dit/object_detection/publaynet_configs/maskrcnn/maskrcnn_dit_base.yaml \
--opts MODEL.WEIGHTS https://layoutlm.blob.core.windows.net/dit/dit-fts/publaynet_dit-b_mrcnn.pth \

Is it correct that images are resized with min_size=800 and max_size=1333 at inference time? Currently, I'm doing this + normalize using the inception mean and standard devation.
cc @lockon-n

Hi @wolfshow,
The script in this PR was outdated, I've got a new script that works. I will open a new PR for this.
Here's the Huggingface Space that lets you try out the model: https://huggingface.co/spaces/nielsr/dit-document-layout-analysis

Hi @wolfshow,
The script in this PR was outdated, I've got a new script that works. I will open a new PR for this.
@lockon-n thanks for the info, here's the Huggingface Space that lets you try out the model for object detection: https://huggingface.co/spaces/nielsr/dit-document-layout-analysis

Sure, thanks @NielsRogge!


Read configuration from trackable path

First of all, thank you very much for this excellent project.
I want to synchronize my configuration for simple-bar between multiple machines.
I use chezmoi (git-based) to track my configurations for other applications.
Is there a way for simple-bar to load configuration from some common configuration path, such as .config/simple-bar/simplebarrc.
I know I can always do soft links, but it would be nice if simple-bar support that natively.
Thanks a lot.

Hi!
I was planing on adding an import/export function in settings that would create a json file on user's desktop but I can also add a setting letting the user choose an external file in which simple bar would automatically write user preferences in addition to local storage.
What do you think?
I'm glad simple-bar suits you!

This import / export idea is excellent, but still people has to do it manually.
"The customizable user preferences path" suits me better for my purpose.
It would be perfect for me if this customizable path by default is located at some common configuration path:

$HOME/config/simplebar/simplebarrc
$HOME/.simplebarrc

Thanks a lot for you reply and your passion for this project. It improves my productivity a lot ;)

Hi!
I had to choose a different approach (not far from what we discussed) but I think I will suits you.
There are now 2 new buttons in the settings module: "Import" & "Export". In order to activate them (they are hidden by default) you'll need to activate the "External config file" setting:

The "Import" button will read from "~/.simplebarrc" if existing and the "Export" one will write in this same file. Be-careful this will overwrite the external config file each time you click on it.
There also has been some changes made regarding the signals that needed to be set in your .yabairc: they are no longer required as simple-bar is now doing that itself (see this section in the readme file).
Also process and spaces widgets have been merged so you will need to restart both yabai & Übersicht in order to make everything work again!
Let me know this is ok for you.
And thank your for the compliment and your suggestion. I'm glad you are enjoying simple-bar! :)

Hi,
I pulled your new updates and tested the "external config file". It works well very.
A minor remark, it might be better to store the configuration in some git-friendly format: e.g. yaml.
Thanks a lot.

Better late than never I changed the formatting options for the external json config file: it is now formatted so it should be easier to track changes with git. :)


Kudu.Services.Web fails to run on F5

Currently when we try running the Kudu.Services.Web project directly from VS using F5 it fails since it fails to expand environment variable "%HOME%" (it's not there).

Hi
Kudu will continue to run in Azure App Service. However, this repo will no longer be maintained.
If the problem persists and is related to running on Azure App Service, please open a support incident in Azure:
https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request
This way we can better track and assist you on this case
Thanks,
Joaquin Vano
Azure App Service


New feature - option to use libtcmu without netlink

Some folks might be using libtcmu in their own applications which don't hook into TCMU runner, much like the consumer.c example. In those cases, it can be useful to avoid using netlink altogether. As I'm sure you are aware, it's almost impossible to have more than one user of TCMU when netlink is involved. This is because the kernel broadcasts device events to all TCMU listeners over netlink and simply accepts the first response it receives. This can lead to the following scenario:

Application A creates a TCMU backstore with handler=app_a
The kernel (target_core_user) broadcasts the netlink message to all instances of libtcmu
Application B receives the message first. Application B doesn't have a handler for app_a, so it replies with an error code to the kernel.
The kernel receives the error and aborts backstore creation.
Application A wonders why its backstore creation failed.

Users can avoid using netlink altogether by setting nl_reply_supported=-1 at backing store creation time. This is great as multiple applications using TCMU can now coexist on the same machine. The problem is we don't have a nice way to utilise libtcmu in this model. We need a way to notify libtcmu that a device has been created, reconfigured, removed so the relevant handlers can be called. Currently, this is done via netlink.
This PR allows users to utilise all the great features of libtcmu, but without using netlink. The PR makes the following changes:

modify tcmulib_initialize to take a boolean parameter which informs libtcmu whether or not it should set up netlink. If true we do. If false we don't.
expose new methods tcmulib_notify_device_added, tcmulib_notify_device_removed and tcmulib_notify_device_reconfiged, which application code should call to inform libtcmu that a device has been added, removed, or reconfigured. These API's take the dev_name and pass through to the existing device_add, device_remove and device_reconfig functions in libtcmu.c. tcmulib_notify_device_reconfiged will need additional parameters to specify the new config.
updates the documentation to reflect these changes and notes that tcmulib_master_fd_ready and tcmulib_get_master_fd should not be called if you chose to call tcmulib_initialize in "don't use netlink mode".
adds an example application consumer_no_netlink which shows how to create a standalone application using libtcmu without netlink.

Initial discussion of this feature: https://github.com/open-iscsi/tcmu-runner/issues/678

Relates to https://github.com/open-iscsi/tcmu-runner/pull/519,

@geordieintheshellcode
Could you add the detail comments and signed-off-by in the commit ?

@geordieintheshellcode
Could you add the detail comments and signed-off-by in the commit ?

Done.

Fixed commit comments

+1 For my use-case i need for multiple libtcmu instances in different containers to coexist. @geordieintheshellcode thank you for your contribution. I will port your PR to my fork for now https://github.com/hocus-dev/photon-libtcmu


Add an option for indicating a direct replacement of a deprecated variable.

old := ferrite.
    Duration("OLD", "example duration variable").
    Deprecated(
        WithDirectReplacement(new),
    )

new := ferrite.
    Duration("NEW", "example duration variable").
    Deprecated()

The goal here is twofold:

Allow documentation to point to the replacement environment variable
Surface the value of the new variable via the old.DeprecatedValue() method

Resolution logic for old.DeprecatedValue() pseudo code
if OLD is defined {
  if OLD matches schema of OLD {
    return OLD
  }
  return error
}

if NEW is defined {
  if NEW matches schema of OLD {
    return NEW
  }

  // we _could_ optionally return nil here indicating no value is available,
  // but I think that would be less useful
  return error
}

return nil

The behavior of NEW is unaffected, it is unaware that it is the replacement for OLD.

/cc @ezzatron I would appreciate your thoughts on this. Note this is specifically about the new WithDirectReplacement() suggestion, the Deprecated() feature is already on main.
The .DeprecatedValue() naming might be a little confusing. This naming is to differentiate it from the .Value() method of NON-deprecated variables so that when you deprecate a variable you are forced to identify the places within your codebase where it is used and explicitly opt-in to continue using the deprecated variable if you wish to do so.

I guess that way could work. .DeprecatedValue() is kind of backwards to how I would have attempted to implement it myself though. I'd want to be able to update my consuming code to use the new variable immediately, and simply delete the old variable when ready without any changes to consuming code (or as few as possible). That would lessen the burden a few months down the track when it's time to remove your deprecated value.
So I suppose that might make the regular .Value() pseudocode look more like:
if self is defined {
  if self is valid {
    return self value
  }

  return error
}

if self is replacing x {
  if x is valid {
    return x value
  }

  return error
}

return nil

In this approach you might start with this:
old := ferrite.Duration("OLD", "example duration variable")

func main() {
    fmt.Println(old.Value())
}

Do the majority of the work to set up and use the new variable in one change:
  old := ferrite.Duration("OLD", "example duration variable")
+     .Deprecated(
+         WithDirectReplacement(new),
+     )
+
+ new := ferrite.Duration("NEW", "example duration variable")

  func main() {
-     fmt.Println(old.Value())
+     fmt.Println(new.Value())
  }

Then future you doesn't have much mental overhead when it's time to remove the deprecated variable:
- old := ferrite.
-     Duration("OLD", "example duration variable").
-     Deprecated(
-         WithDirectReplacement(new),
-     )
-
  new := ferrite.Duration("NEW", "example duration variable")

  func main() {
      fmt.Println(new.Value())
  }

It probably also depends what you consider a "direct replacement". I would only expect Ferrite to manage all of this for me if the type of values being produced were identical. If the new variable doesn't produce the same type but is still conceptually a replacement, I might want some way to indicate that so that it's documented, but I don't think I'd expect Ferrite to handle the fallback logic for me, and this might be a case where adding some free-form notes to a variable would suffice.

Thanks man! :heart:  Wall of text incoming, apologies! We can chat about this in person, but I'll still get my thoughts down here.
I think the key take away here is that rather than surfacing the NEW value via the old variable, you'd have new fall-back to the value of OLD.  Is that right? If so I think that does make much more sense!
Perhaps the deprecated variable could also look at the value of NEW, making it a bidirectional relationship.

It probably also depends what you consider a "direct replacement". I would only expect Ferrite to manage all of this for me if the type of values being produced were identical.

I don't think it matters whether the replacement is the same type, as ultimately the input is always a string. Consider for example, migrating from a String() variable type, to the more recently added URL() type. Assuming there's some reason you're not just changing the type of the existing variable, a syntactically valid URL supplied as a value to the original String() variable will still be valid when evaluated as a URL().
So I'd define a direct replacement as:

Having a different name, obviously
Having the same semantic meaning to the user
Negating the need for the deprecated variable

So perhaps logic as follows:
if self is defined {
  if self is valid {
    return self value
  }

  return error
}

if self is replacing x {
  if x is defined {
    if x is valid as per self's definition {
      return x value
    }
  }
}

if self is required {
  return error
}

return nil

In summary, fallback to OLD only if it's valid according to NEW's schema, otherwise simply ignore it.

this might be a case where adding some free-form notes to a variable would suffice

Yep, definitely want to be able to do this. Was thinking also of allowing a SeeAlso() option (independent of deprecation features).

The rest of this reply is just me trying to get my thoughts down about the .DeprecatedValue() decision.

I'd want to be able to update my consuming code to use the new variable immediately, and simply delete the old variable when ready without any changes to consuming code (or as few as possible)
...
Then future you doesn't have much mental overhead when it's time to remove the deprecated variable:

This is definitely the intent. Ferrite using the .DeprecatedValue() naming forces you to update your consuming code immediately or otherwise deliberately opt-in to continued use of the deprecated variable. I wouldn't want to disallow use of the deprecated variable if using the new one is difficult in the short term or happening as part of a larger refactor, for example.
The .Deprecated() method is an alternative to the existing .Required() or .Optional() methods; it cannot be used in conjunction with them. This follows from my assumption that if you're deprecating a variable you want people to stop using it and therefore it's nonsensical to have a variable that is both required and deprecated.
With that in mind, a change from .Required() to .Deprecated() would cause a change to the return values of .Value() anyway, as optional variables return a boolean indicating whether a value is available. Using a different name for this method ensures that the existing consuming code breaks in the same way regardless of whether the variable was previously required or optional.
Anyway, this makes more sense with the pseudo code you suggested, as best I can tell :)

I think the key take away here is that rather than surfacing the NEW value via the old variable, you'd have new fall-back to the value of OLD. Is that right? If so I think that does make much more sense!

Yep, that was my main thought.

I don't think it matters whether the replacement is the same type, as ultimately the input is always a string. Consider for example, migrating from a String() variable type, to the more recently added URL() type. Assuming there's some reason you're not just changing the type of the existing variable, a syntactically valid URL supplied as a value to the original String() variable will still be valid when evaluated as a URL().

Yeah, okay. I can see why that would be desirable.

In summary, fallback to OLD only if it's valid according to NEW's schema, otherwise simply ignore it.

An issue I see with this logic is in the case where:

NEW is required
NEW's value is undefined
OLD's value is defined
OLD's value is invalid according to NEW's schema

The user is going to see a message saying that NEW is undefined, with no indication that the problem is actually because OLD's value doesn't match NEW's schema. This means there's a potential for BC breaks from the user's perspective, which are easy to overlook from the implementor's perspective.
You could work around this as an implementor by making them both optional and validating that one is set correctly in consuming code, but that kind of undermines the goals of making it easy to remove deprecated stuff later.
I think I'd prefer, when falling back to the deprecated variable, that if that variable doesn't match the new schema, it produced an error indicating as much. Now, I guess that's still a BC break technically, but you could argue in cases like string to URL transition, it was always supposed to be a valid URL, so if you were able to supply a poorly-formatted URL string before, that was a bug, not a feature. At least the user gets an error message that clearly explains what's actually happening.

In other words, I'm just advocating for this change:
  if self is defined {
    if self is valid {
      return self value
    }

    return error
  }

  if self is replacing x {
    if x is defined {
      if x is valid as per self's definition {
        return x value
      }
+
+     return error
    }
  }

  if self is required {
    return error
  }

  return nil

The user is going to see a message saying that NEW is undefined, with no indication that the problem is actually because OLD's value doesn't match NEW's schema.

This doesn't have to be the case, the information is available to explain exactly what happened.

Ideally you want any BC breaks to happen when you finally remove the deprecated variable.

I like this, I think this has to be one of the main design considerations of Deprecated() in general :+1:

I think I'd prefer, when falling back to the deprecated variable, that if that variable doesn't match the new schema, it produced an error indicating as much.

Yep, that makes sense. Otherwise, for optional variables at least you have a case where a value was attempted to be provided but was ignored completely.

You could work around this as an implementor by making them both optional and validating that one is set correctly in consuming code, but that kind of undermines the goals of making it easy to remove deprecated stuff later.

For sure. This is the exact thing I want to avoid, because it's not introspectable, and therefore I can't explain it to the user automatically.

I've added a SupersededBy() deprecation option. It doesn't yet perform any of the fallback logic discussed above, but successfully models the relationship between the two (or more) variables, and includes some information in the generated documentation.

Moving out of v1.0.0 milestone. As discussed this particular approach adds a situation where a variable spec is modified after it has already been "finalized" (and perhaps already used by the application in uncommon cases).
I would still like to explore other options for achieving the same thing here, but we don't have a pressing need ourselves anymore.


Google Drive still working or not ?

I tried on my PC but seem google drive not work anymore, any confirm?

I got this when try
[GoogleDrive] 1nKFz0zVmqdb9yWzmw3GiQN8zTDuBXlWB: Downloading webpage
[GoogleDrive] 1nKFz0zVmqdb9yWzmw3GiQN8zTDuBXlWB: Requesting source file
ERROR: unable to download video data: HTTP Error 302: The HTTP server returned a redirect error that would lead to an infinite loop.
The last 30x error message was:
Found