[Feature Request] No Sleep / Keep Awake ("caffeinate" on macOS)

Summary of the new feature/enhancement
This feature would prevent the OS from going to sleep with the options to set a timer for when it can go back to sleep. This functionality is provided by the following two sources for free; however, I choose not to use these since they are not open-source (or I couldn't find the source code). Also the caffeine software uses key strokes which is less than desirable than an API approach that amphetamine takes.
https://zhornsoftware.co.uk/caffeine/
https://www.d7xtech.com/free-software/amphetamine/
Basic implementation details

Right clicking on PowerToys system tray icon will display whether or not this feature is currently active
Right clicking on PowerToys system tray icon will have an option to allow someone to start/end this feature with a default setting
Right clicking on PowerToys system tray will also include options for this feature where you can quickly specify a time limit for this feature (e.g. Keep Awake for 5 min, 1 hour, Forever, etc)
PowerToys Run can activate/deactivate this new feature quickly

Not sure if we should make this a PowerToy. There are many existing applications. For example Don't sleep.

@htcfreek I also pointed out a few other alternatives, but I thought we could still add it here since there are also a few alternatives for the other features of PowerToys. Also I wasn't able to find a good open source version of this feature that I would feel safe and confident to install on my machine. However, I do understand we wouldn't want to have too many features or bloat in PowerToys. I just thought I would post anyways.
Also if anyone knows the APIs or a best practice on how to do this, I would appreciate any tips or nudges in the right direction so I might be able to implement this for myself. Thanks!

@pma9
As far as I know there must be an api to say Windows you need the monitor and that it should not sleep or reboot. This api is used for example by video players.

question: does the Power management settings not work appropriately?

@crutkas The feature targets more of a quick way to prevent your computer from sleeping. In many cases, it will only be turned on for a specific amount of time. One example is when you are running some program or test and you want to step away from the computer without having to go into your settings to turn off the sleep. Another example is sometimes I'd like to make sure my computer doesn't sleep when we are using the computer to play music and other people would like to control the playlist but I wouldn't want them to have my password.

You might try using Insomnia  - the source code is provided, if that's Open Source enough - you can see the APIs used there.  For me a shortcut to run the program minimized to the notification area is fine.  I've never felt the need for a timeout feature, never knowing how long whatever is going on will take.  (For me it's often uploading stuff to OneDrive.)

There is a clean API in Windows that can be used for this purpose, if you don't want to mess around with power profiles (as mentioned in #7999) - SetThreadExecutionState. With the ES_DISPLAY_REQUIRED flag set, this should do the trick. This API just needs a nice wrapper in PowerToys.

Like said presentation mode is already doing a good job. Try to give that one some tlc instead of reinvest the wheel. Make presentation mode available on windows sku's (it's only on pro available now) and add it to quick action instead of dumping it in system tra.. everyone happy

OK, so just to summarize the proposal, and @crutkas and @enricogior - I'd like to get your thoughts on whether this is a go/no-go.
Functionality
Toggle to enable or disable the Espresso tool
This will be either on or off. When it's on, the user can set up the type of "caffeination" they want to enable for their machine (see below). When it's off, the machine operates under normal constraints, as defined in the current power management plan.
Indefinite keep-awake
In this mode, the machine is kept "awake" (preventing lock) indefinitely.  The machine does not go to sleep while this functionality is enabled. The user will have to explicitly disable this for the machine to go to operation under its current power management plan.
Temporary keep-awake
The user defines a time, in hours and minutes, during which the machine is kept "awake" (preventing sleep). Once the time elapses, the machine resumes operation under its current power management plan
Toggle or enable display availability
If toggled, the machine will keep the displays on, and the machine will not be locked for the duration of the keep-awake mode. If not toggled, the machine will not go to sleep, but the displays can turn off/switch to screen saver mode, effectively locking the machine.
System tray integration
When, and only when, Espresso is enabled, and is keeping the machine "awake", a tray icon is displayed to let the user know that the machine currently is kept "awake." From the tray icon, the user can:

Disable the keep-awake functionality altogether. In this case, the tray icon will disappear, and the user will need to enable it back from PowerToys settings.
Switch between indefinite and timed keep-awake, with timed keep-awake offering a pre-populated collection of options, such as 1 hour, 2 hours, 3 hours, 4 hours, 5 hours, and "Custom..." Selecting the latter option will take the user to PowerToys settings.
Enable or disable display keep-awake.

Command-line integration
The tool will offer a command-line interface, allowing the user to call:
espresso -d -t 3600

Argument
Description

-d
Keep the display on (prevent lock).

-t
Define a time during which the keep-awake mode should be enabled.

The -t argument will enable timed sleep prevention, in seconds, similar to caffeinate on macOS. Omitting the -t argument will result in an indefinite "awake" state,
Omitting the -d argument will result in the machine not going to sleep, but the screens can turn off and lock the computer.
Settings set in the command line will be reflected in the tray and the PowerToys settings.
In the future, the command-line interface (CLI) can be extended with other assertions.
FAQ
Q1: What about the system power management policy?
The goal of this tool is not to mess with that at all. Instead, we would rely on a native Windows API that enables fine-grained control of applications requesting the OS to not sleep. This application is not a replacement for power management policies.
Q2: Will this enable social engineering/insecure access to computers?
No. The API we are using are the same that are triggered when a media player is playing a video. The alternative to this tool is playing a video on a loop. The Espresso tool will enable control of the process, where the machine can still be locked (the screens are off), but is not asleep.
Q3: What about other scenarios that need to be tackled?
Out-of-scope for the first release, but it would be nice to add the ability to map the keep-awake to a process (e.g. "wait until Adobe Premiere exits, then you can make my computer go to sleep"), but that requires more extensive research. Another functionality that is worth investigating is conditional keep-awake, i.e. enable this but only if on AC power, or scheduled keep-awake.

This sounds good.

espresso systray is ok, this upholds if this was independent

we should think how we can integrate this the future flyout

Cmd: good, don't we have to add this to the PATH?
Make sure our Settings app can show off any current loop espresso is running and being able to stop it.

On (2) - potentially. Does not preclude the user from just using it directly from within the folder where Espresso is located. On (3) - ack, will make sure that the state is reflected. Thanks @crutkas - working on this ☕

@crutkas @dend
it seems a less important thing, but let's decide a final name for this module right away. Renaming folder/projects after the initial merge to master has a significant impact on the localization process.

You might want to investigate the effect the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\7516b95f-f776-4464-8c53-06167f40cc99\A9CEB8DA-CD46-44FB-A98B-02AF69DE4623 may have on the feature.  It claims to control whether to "Allow programs to prevent display from turning off automatically".  Presumably that's a policy setting used by someone somewhere which might mean the 'keep display on' feature won't work - probably not a worry generally, but equally they'll probably be a bug report/dissatisfied user some time.

That's a great call-out @ajkajk - will include that in the test plan, really appreciate you bringing this up!
@enricogior @crutkas I think Espresso is easy to remember and use, and it alludes to the caffeination process 😃 There is a number of projects on GitHub with this name, but they all serve different purposes. I also think that this is generic enough where it is not 1/offensive, or 2/associated with any particular software or brand.

Updating on the progress - I've got some of the core application logic implemented. Fiddling with settings now to see how to connect those 😃

@enricogior @crutkas I have the fundamentals in the fork - now the work starts on marrying the application with the settings UI.
The approach I am currently thinking is that there are two pathways for the user:

User starts the application from the PowerToys settings UI. The moment they enable Espresso, the application starts with sane defaults, and once the user changes the settings, the application re-starts with the appropriate settings applied.
The user starts the application outside of PowerToys. In this case, ideally I'd like to make sure that PowerToys picks up the state of the process, and for that it needs to have some kind of access to said state.

For (2), I am not sure how valuable it is to actually implement this bi-directional settings binding. That is, as a user, do I care if I start Espresso outside of PowerToys, to see the settings reflected in the PowerToys settings UI? If yes, I can write the settings from Espresso to PowerToys JSON files in %USERAPPDATA% when Espresso is launched.
What do you think of the above?

All app data is in %localappdata%\Microsoft\PowerToys
Espresso would be in %localappdata%\Microsoft\PowerToys\Espresso
I think the settings pane for Espresso when loaded:

Tell user if espresso is active (fine if this is when settings pane is on each load vs real time)
show current state of settings / set settings. If someone does a direct update to the JSON file, i don't think any tool has the settings instantly reflected.  If a setting is adjusted then in settings, expected behavior is settings would overwrite it.

@dend

User starts the application from the PowerToys settings UI

The Settings apps only reads and writes the json configuration file, it doesn't start/stop the application.
The application needs to implement a file watcher and react accordingly.

The user starts the application outside of PowerToys

The application should support to start outside of PowerToys for debug purposes only.

@enricogior @crutkas OK, so that leads me to an interesting point - technically PowerToys would be responsible for launching the application, because of its potential temporary nature. Espresso currently doesn't run constantly in the background (but maybe it should).
My initial thought was that through PowerToys, as a user I can "launch" Espresso by enabling it, configuring the right settings in the UI, and once it's done working, the process terminates. It seems like that would be counter to the current PT model, because I see tools like ColorPicker launch and sit in the background when the PT process starts.
So, proposal - we make Espresso run in the background, and it watches the settings file for changes constantly, but only when explicitly enabled. It would map to the behavior of the ColorPicker, as an example, where the process starts when enabled, and shuts down when disabled. Thoughts?

@dend

So, proposal - we make Espresso run in the background, and it watches the settings file for changes constantly, but only when explicitly enabled.

If the module it's on, it's OK to make it run in the background all the time and monitor the settings file.
The running process name will be PowerToys.Espresso.exe
Btw, we are dropping support for the old settings, so there will be changes coming up for the module interface implementation since the module will not be required anymore to implement get_config and set_config.

Cool, thanks @enricogior - working on the changes.

Update - got the Espresso tool updated with an option to point to a config file to watch: https://github.com/dend/PowerToys/blob/a0c5f8cc59022cdb9d299ff29ac64ea0c53f9d29/src/modules/espresso/Espresso.Shell/Program.cs
I will be testing and debugging the tool over the next couple of days, but I believe that the functionality is implemented - I just need to properly integrate it with PowerToys and test against edge cases. Basically, I am where I was last week, but with file monitoring functionality done 😎

You might want to investigate the effect the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\7516b95f-f776-4464-8c53-06167f40cc99\A9CEB8DA-CD46-44FB-A98B-02AF69DE4623 may have on the feature.  It claims to control whether to "Allow programs to prevent display from turning off automatically".  Presumably that's a policy setting used by someone somewhere which might mean the 'keep display on' feature won't work - probably not a worry generally, but equally they'll probably be a bug report/dissatisfied user some time.

@dend
If this policy has impacted on your newoule we should suggest to show a warning in settings ux and maybe have a warning symbol and tootltip message on the tray icon.

Above someone mentioned that the state if your module should be visible in settings ux.
If it's enabled and configured to prevent until disabling the module the state is crlear in settings. But what about the configuration for temporary blocking?
I suggest to have a information text between on/off toggle and first settings group like this:

State
Message

Blocking on
State: Preventing sleep.

Blocking temp. on
State: Preventing sleep until

Blocking temp. on, time elapsed
State: off or time elapsep

Blocking off
State: off or time elapsed

Suggestion for Module name:

PowerToys StayVisible
PowerToys StayOn
PowerToys MonitorOn

If it's enabled and configured to prevent until disabling the module, the state is clear in settings. But what about the configuration for temporary blocking?

Not following - temporary blocking of what aspect?

Suggestion for Module name:

I believe we landed on Espresso  ☕
As a general status update, currently writing the C++ code that is required to launch/stop the Espresso module correctly from the settings UX. Logging works, sleeping and monitoring of settings works (through some Rx magic to prevent duplicate event processing in FileSystemWatcher). My goal is to work through the final requirements this weekend and submit a pull request for review and testing early next week (slight delay from my "this week" assumption).

If it's enabled and configured to prevent until disabling the module, the state is clear in settings. But what about the configuration for temporary blocking?

Not following - temporary blocking of what aspect?

If the module is off, then the toggle states this clearly.

If the module is on and sleep is blocked until disabling the module, the ux is clear too.

If the module is on and the sleep is blocked temporary (for a defined time) the ux is maybe not clear. Only because of the time setting, it is not clear if the time is running (and sleep is blocked) or if the time span is ended (and sleep is not blocked).

I hope you now it's clear what I mean.

Suggestion for Module name:

I believe we landed on Espresso  ☕

Sory. Then I missed this.

As a general status update, currently writing the C++ code that is required to launch/stop the Espresso module correctly from the settings UX. Logging works, sleeping and monitoring of settings works (through some Rx magic to prevent duplicate event processing in FileSystemWatcher). My goal is to work through the final requirements this weekend and submit a pull request for review and testing early next week (slight delay from my "this week" assumption).

Would be great if you can add screenshots to your pr description. 👍

Another update:

Settings are now completely wired.
PID binding for the PowerToys process is in place, so the shell can operate well together with PT running/closing.

Spending next couple of days testing edge cases and the scenario that @ajkajk called out above with the registry key.

@dend Great, looking forward :)! Can you post a screenshot of the Settings screen - anything there you want me to look at for that?

@dend I could help writing the docs, if you don't want to do it yourself.

Test panel - posting for reference so I know what scenarios I need to validate.
✅ - Pass
🛑 - Fail
🟨 - Not tested

Users can...
✅
🛑
🟨

[Standalone mode] Set timed keep-awake with display off

[Standalone mode] Set timed keep-awake with display off

[Standalone mode] Set indefinite keep-awake with display on

[Standalone mode] Set indefinite keep-awake with display off

[Standalone mode] Set timed keep-awake with display off from settings file

[Standalone mode] Set timed keep-awake with display off from settings file

[Standalone mode] Set indefinite keep-awake with display on from settings file

[Standalone mode] Set indefinite keep-awake with display off from settings file

[Standalone mode] Abruptly interrupt the execution, return machine to normal state

[Standalone mode] Mess up settings in the settings file when the app is bound to it

[Standalone mode] Bind the application to a PID

[Standalone mode] Set up keep-awake with blocking registry key in place

[Standalone mode] Delete settings file while Espresso is running and bound to the file

[Standalone mode] Point the application to a non-existent settings file

[Standalone mode] Attempt to start a second instance of Espresso

[PT Mode] Set timed keep-awake with display off

[PT Mode] Set timed keep-awake with display off

[PT Mode] Set indefinite keep-awake with display on

[PT Mode] Set indefinite keep-awake with display off

[PT Mode] Set up keep-awake with blocking registry key in place

[PT Mode] Change settings manually through file editing

[PT Mode] Mess up settings file and restart PowerToys to attempt to load the bad settings

[PT Mode] Delete settings file while PowerToys and Espresso are running

[PT Mode] Delete settings file while PowerToys and Espresso are running

[PT Mode] Attempt to start a standalone copy of Espresso outside of PowerToys

@niels9001 YES! Was just about to ask that. Here is what settings look like:

@Aaron-Junker will have a separate PR that we can collaborate on for the docs. Lots of room to improve! 👍

@dend Great!
Settings screen
For my understanding:
Keep display on: this will keep the computer awake at all times, but will either keep the screen on or turn it off. This setting is not related to the 2 behavior options ("Keep awake indefinitely" vs. "Keep awake temporarily") correct?
Icon
I can make a "Fluent" version of the coffee cup. Is the one you are using now part of Segoe MDL2 Assets?
What will the Tasktray icon do exactly? Show that Espresso is turned on? Does anything happen once you click on it?
Image
Yeah good one.. there's not really a UI that we could use as a screenshot for the image, except for the task tray icon right? Let me think of something that would make sense :).

this will keep the computer awake at all times, but will either keep the screen on or turn it off. This setting is not related to the 2 behavior options ("Keep awake indefinitely" vs. "Keep awake temporarily") correct?

Yes, that is correct!

I can make a "Fluent" version of the coffee cup. Is the one you are using now part of Segoe MDL2 Assets?

Yep - that's the one. The system tray will allow the user to switch to see that Espresso is running, and switch between indefinite and timed modes. Once you click it, a menu will show up that gives those options.

Yeah good one.. there's not really a UI that we could use as a screenshot for the image, except for the task tray icon right? Let me think of something that would make sense :).

I wonder if this can be something generic, computer being awake. Like a monitor with a coffee cup on it. What do you think about this?
Thank you for all the help with this, @niels9001!

@dend
Suggestion for the settings window:

State information
change hierarchy
text improvements

@htcfreek Good suggestions IMO.
@dend Is there a branch on this repo I can PR against making UI changes to the settings?

@niels, @dend,
Regarding status: This is the idea i mentioned a few comments before. Only not sure what to show if plugin is disabled. Maybe State: .

This tool looks great and looking forward to using it. Is it possible to integrate it with PowerToys run e.g. search prevent sleep instead of using a system tray icon?

This tool looks great and looking forward to using it. Is it possible to integrate it with PowerToys run e.g. search prevent sleep instead of using a system tray icon?

A second step would be to create a PT Run plugin stat interacts to the espresso process by using it's command line.

@Aaron-Junker will have a separate PR that we can collaborate on for the docs. Lots of room to improve! 👍

@dend Tell me when you made it!

@crutkas
What about telemetry? Should we have a separate issue for implementing?
Idea: If we know preferred times, we could add suggestions to tray (e. g. next 2 hours).

@htcfreek telemetry is important, but I think we can get it in the next release. Let's get the first release out the door, since it contains core functionality, and then we'll continue evolving it with all the nice-to-have items.

@htcfreek telemetry is important, but I think we can get it in the next release. Let's get the first release out the door, since it contains core functionality, and then we'll continue evolving it with all the nice-to-have items.

@dend
Only asking because i saw no issue or work list item regarding telemetry.

Is there any way to remove the little coffee cup icon from the toolbar if the feature's turned off?

Is there any way to remove the little coffee cup icon from the toolbar if the feature's turned off?

Right click -> Exit

@Aaron-Junker hah, I did that and the icon lingered around. Went to right click and do it again, and it went away.

Resolved with the release of PowerToys Awake in v0.41!
Thanks @dend!


Unwanted conversion from string to integer in examples

Describe the bug
My examples are being converted to integers although they should be strings (ex: phone numbers).
This causes problem when validating my openapi file, as the parameter is set as "string" but has a number as example.
To Reproduce

Given this OpenAPI document

openapi: 3.0.0
info:
  title: My title
  version: 1.0.0
paths:
  /my/route:
    post:
      summary: My route
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                phone:
                  type: string
                  example: "0612345678"
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request

I execute the combine command
I get the following document (Notice the number example)

openapi: 3.0.0
info:
  title: My title
  version: 1.0.0
paths:
  /my/route:
    post:
      summary: My route
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                phone:
                  type: string
                  example:<PHONE_NUMBER>
        required: true
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request

Expected behavior
I expected my example to stay as a string.

This seems to be a bug in the js-yaml package.
See: https://github.com/nodeca/js-yaml/issues/530
Tried it with your example:
node -e "console.log(require('js-yaml').safeDump({example: '0612345678'}))"
//  example:<PHONE_NUMBER>

Using only digits below 8 (octal digits) seems to work fine:
node -e "console.log(require('js-yaml').safeDump({example: '0612345677'}))"
//  example: '0612345677'


Custom attributes

How can I access custom attributes? I have set the persist_raw_claims(true) but now what?
I have tried reading the code and in the code if persist_raw_claims is set there should be a tuple looking like so: (RawClaims, KeycloakToken<String>) but doing this in a handler function isn't working: Extension<(RawClaims, KeycloakToken<String>)>.

Ok, I think I figured it out. You have to do two separate extractors, one for KeycloakToken and one for RawClaims.

Hi, I faced the same situation today. Here's how I solved it:

Router::new()
//...
.route_layer(axum::middleware::from_fn(database_middleware::set_pool))
//...

//in my database_middleware.rs
pub async fn set_pool(
    Extension(raw_claims): Extension<RawClaims>,
    req: Request,
    next: Next,
) -> Result<Response, StatusCode> {

    //extrat tenant from keycloak
    let tenant = if let Some(Value::String(tenant)) = raw_claims.get("tenant") {
        tenant
    } else {
        println!("Tenant key not found in the raw_claims");
        return Err(StatusCode::UNAUTHORIZED);
    };

    println!("Tenant: {}", tenant);

    // ...

}


Passwords to meet WCAG 2.1

There is a guidance change needed to ensure users implement the passwords pattern in accordance with WCAG 2.1.
This closes issue:

Pages with 2+ password fields must use different programmatic labels for 'show' and 'hide' buttons on those password fields #2795

Closing this pull request as there is already work going on to fix this in Add guidance on show/hide password buttons #2861


fix: clarify github required scopes

fix: clarify github required scopes
Description
clarify github scopes,

[ ] This change requires a documentation update
[ ] I have made corresponding changes to the documentation

Related Issue(s)
This PR addresses issue #1513
Screenshots

@Tpuljak I think we have a flaky test , this one is not intended to fail here

Yup, I'll fix it in another PR


docs: [integ-doc] upgrading the framework

Note

Add documentation on the part of upgrading the framework.

@jarindr I added you as a random reviewer to make sure I don't write doc that only our teams understand XDDD

@boolafish this looks good. There are a few grammatical errors, but @cduangprom is currently reviewing the entire integration doc, so let's get this part merged so that she can include it.

@kevsul and @boolafish it's my last day today. If you'd like me to update the markdown file with the changes I made so devs can add to it going forward, please let me know asap. This is the latest edited version https://docs.google.com/document/d/10ncmCFBhqGCKCilkwuA58BQYQThTlZyWW-EE_LUJnHg/edit#

@cduangprom thanks for all the effort you've done!
I will merge this now, so if you still got some capacity today can you please add this part to the google file as well? Great thanks!

@boolafish
Shouldn't I just update the markdown file?

ah...okay I might have misunderstood your previous sentence. Yes markdown file is what should be done. Sorry for that ><

OK, will take a look at the latest version with your update and make the changes from the style/formatting point of view. So next version you all collaborate on should then be the edited doc


Compact side-by-side layout

Hi - i can't seem to find anything in the doc or examples showing if it's possible to layout the form such that the labels are to the side of the field, instead of above.  I'd like that for space saving purposes.  Can anyone shed some light on this?  I hope I'm just not looking in the right spot.
Thanks!

There isn't a compact side by side layout implemented. Basically you can either use CSS to force it around or make a copy of the "bootstrap decorator" part of the project and modify the templates.

The boostrap grid layout can be applied by setting a htmlClass of row, labelHtmlClass as col-xx-* and fieldHtmlClass. One caveat: radio and checkbox lists apply the fieldHtmlClass to each input tag, so you may need to leave the fieldHtmlClass undefined for those types of questions. Unless you need something complicated, that'll get you most of the way there.

Please re-open if you feel the answers were insufficient and you require more information.


Docker build seems broken

Starting the application using docker-compose up --build fails to start the application.
Creating expresscart         ... done
Attaching to expresscart-mongodb, expresscart
expresscart    |
expresscart    | ><EMAIL_ADDRESS>start /var/expressCart
expresscart    | > node app.js
expresscart    |
expresscart    | /var/expressCart/node_modules/got/dist/source/create.js:157
expresscart    |     const paginateEach = (async function* (url, options) {
expresscart    |                                         ^
expresscart    |
expresscart    | SyntaxError: Unexpected token *
expresscart    |     at createScript (vm.js:80:10)
expresscart    |     at Object.runInThisContext (vm.js:139:10)
expresscart    |     at Module._compile (module.js:617:28)
expresscart    |     at Object.Module._extensions..js (module.js:664:10)
expresscart    |     at Module.load (module.js:566:32)
expresscart    |     at tryModuleLoad (module.js:506:12)
expresscart    |     at Function.Module._load (module.js:498:3)
expresscart    |     at Module.require (module.js:597:17)
expresscart    |     at require (internal/module.js:11:18)
expresscart    |     at Object.<anonymous> (/var/expressCart/node_modules/got/dist/source/index.js:14:18)
expresscart    | npm ERR! code ELIFECYCLE
expresscart    | npm ERR! errno 1
expresscart    | npm ERR<EMAIL_ADDRESS>start: `node app.js`
expresscart    | npm ERR! Exit status 1
expresscart    | npm ERR!
expresscart    | npm ERR! Failed at the<EMAIL_ADDRESS>start script.
expresscart    | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
expresscart    |
expresscart    | npm ERR!  Any ideas what's wrong and how to fix?

I'm not a huge Docker user. Any ideas what's wrong and how to fix?

I tried changing the node version but no luck. Suspect some issue with got - https://github.com/sindresorhus/got/issues/1084

the current version of node in this dockerfile is a deprecated LTS.
You can change the dockerfile with mine. this one works for me.
https://github.com/meiremans/expressCart/blob/master/Dockerfile

@meiremans I used your github repo of expressCart but after building when i go to localhost:1111
it doesn't have any product listed......
can you tell me the reason for this, Kindly
Thanks

@PraveeenPandey You have to add the products yourself in the admin interface

Thanks @meiremans,
Glad you replied, i actually tried logging and tried using admin interface.
but u cannot access the cuz lack of credentials.
i tried some which are :
Demo credentials
Admin User:

User<EMAIL_ADDRESS>Password: test

Customer:

User<EMAIL_ADDRESS>Password: test

Discount code:

10 amount: DEMO_AMT10
10 percent: DEMO_PCT10

but they result in saying no account under this email.
Thanks Again
Appreciate the response.


TODOs, Ideas and Feature Requests ✨

I'm listing here all my ideas to this project. I'd create a different issue for each one of them, but since it's a long list, I'd rather list them all on a single issue and use this same one as a space where everyone can add their ideas or feature requests (FR). If an idea/FR needs further discussion, it shall go into a new issue.
✨ Almighty List:

[x] Improve the UI (Done in #3);
[ ] Connect to the Firebase Realtime Database to remote control the device. Remote controlled actions (may) include:

[x] Change device name (Done in #4);
[x] Pair and disconnect devices (Done in #4);
[ ] Manage list of devices and display current connected device;
[ ] Adjust ~volume~ (Done in #4) and brightness;
[ ] Change UI colors.

[ ] Allow Selecting Wi-fi networks? (I have to check if their APIs allow this; but I believe they do);
[ ] Create a complimentary PWA that connects to Firebase for remote control;
[ ] Create a dialogflow app that connects to Firebase for remote control with voice commands;
[ ] Make the screen optional (this means finding other ways of input and output, such as the two points above);
[ ] Create a Screensaver (can be a slide of all pictures stored in Cloud Firestore, or a screen displaying the current time and weather);
[ ] Integrate the app with a streaming service to be able to play songs straight from the internet.
[ ] Develop a website describing the project (will probably write a blog post as well)

Feel free to comment your idea or feature request below. 🙂

In order to allow having a Screensaver and a streaming service (since these 2 will require new activities), I'm considering using a Service to listen to events at all times.


Assign work to an agent when it gets new software

The new software might allow it to run work where previously it
couldn't.

LGTM, merging.  Sorry for the delay.


Can't Log In to Grafana for the first time

Can't log in to Grafana from the :3030 Grafana login using the user: admin and password:admin. I then tried changing the password in the config.yml and still no joy. I think it might be related to this issue:
https://community.grafana.com/t/login-issue-after-update-to-10-1-0-coming-from-10-0-3/101990/7
Seems like the solution is downgrading version of Grafana, but not sure how to accomplish that here.

I figured it out here https://github.com/geerlingguy/internet-pi/issues/542#issuecomment-1699872297


Using proxy feature

Hey Phil! There is one problem with using ur script  with proxies... When I setup it I can't login to tg account/ no generating qr-code for logging and etc

How to solve it? Need make many sessions with different proxy

Hi,
Looks like you don't have a connection, everything's timing out.

Hmm idk showing online in pm2 and this proxy is working rn(checked in browser)
type of this proxy HTTP mb in that problem?

I’ll look at add some more error checking to the proxy set up. In the coming days. In the short term, you could enable debugging screenshots and see what’s happening when you try to set up an account.

Where can I find these screenshots?

I have the same problem with him. But phil said because of quality of proxy. When I tried change https to http in the file setupproxy.py It’ working, like another topic talking about that

I have the same problem with him. But phil said because of quality of proxy. When I tried change https to http in the file setupproxy.py It’ working, like another topic talking about that

ow what exactly did u change?

I have the same problem with him. But phil said because of quality of proxy. When I tried change https to http in the file setupproxy.py It’ working, like another topic talking about that

Yes change this https in this line

I have the same problem with him. But phil said because of quality of proxy. When I tried change https to http in the file setupproxy.py It’ working, like another topic talking about that

Yes change this https in this line

anyway cant even join on telegram acc

I have the same problem with him. But phil said because of quality of proxy. When I tried change https to http in the file setupproxy.py It’ working, like another topic talking about that

Yes change this https in this line

This is correct, if a proxy doesn't support a secure connection for authentication, and you are OK sending your authentication credentials on an unencrypted connection, you could remove the "s", but your username and password will be viewable by every relay between the script and your VPN host.

It looks like you have an error here.

Here are some instructions to try to manually install the mitmproxy-ca-cert.pem on Ubuntu:
Manually Installing mitmproxy Certificate on Ubuntu
Follow these steps to manually install the mitmproxy certificate on Ubuntu.
Step 1: Install mitmproxy
First, update your package list and install mitmproxy using pip:
sudo apt update
source venv/bin/activate
pip3 install mitmproxy  # Install mitmproxy if not already installed

Step 2: Generate Certificates by Running mitmproxy
Running mitmproxy for the first time will generate the necessary SSL certificates:
mitmproxy --install

This command will generate the required mitmproxy-ca-cert.pem file in your ~/.mitmproxy/ directory.
Step 3: Locate the Certificate
Verify that the certificate has been generated:
ls ~/.mitmproxy/

You should see mitmproxy-ca-cert.pem in the list of files.
Step 4: Copy Certificate to System Trust Store
To make the certificate trusted system-wide, copy it to the appropriate directory and update the system’s certificates.

Copy the certificate to /usr/local/share/ca-certificates/:

sudo cp ~/.mitmproxy/mitmproxy-ca-cert.pem /usr/local/share/ca-certificates/mitmproxy-ca-cert.crt

Update the system's CA certificates:

sudo update-ca-certificates

This command updates the system’s trusted certificates, making the mitmproxy CA certificate trusted. If successful, you should see a message like:
Updating certificates in /etc/ssl/certs... 1 added, 0 removed; done.
Step 5: Verify Installation
Check the list of trusted certificates to ensure the mitmproxy certificate is now trusted:
ls /etc/ssl/certs | grep mitmproxy

Step 6: Restart Services (If Necessary)
Some services may require a restart to pick up the new certificate. For example, restart your browser or any service that uses SSL certificates.
Troubleshooting:

File permissions issue: If the certificate isn’t being recognized, ensure that the permissions on the file are correct:

sudo chmod 644 /usr/local/share/ca-certificates/mitmproxy-ca-cert.crt

Reinstall the certificate: If something goes wrong, delete the certificate and regenerate it by rerunning mitmproxy:

rm ~/.mitmproxy/mitmproxy-ca-cert.pem
mitmproxy --install

This will regenerate the mitmproxy-ca-cert.pem file.
Finally...
Quit the virtual environment:
deactivate

Once you've been able to confirm the certificate is installed, if you need to reinstall the proxy, the instructions are here.

Once you've been able to confirm the certificate is installed, if you need to reinstall the proxy, the instructions are here.

Hi I must install on docker or ubuntu system?

Once you've been able to confirm the certificate is installed, if you need to reinstall the proxy, the instructions are here.

Hi I must install on docker or ubuntu system?

If you think the certificate  is not installed on your system too, you'd run these commands inside the Docker container:
Step 1: Install mitmproxy
First, update your package list and install mitmproxy using pip:
sudo apt update
source venv/bin/activate
pip3 install mitmproxy  # Install mitmproxy if not already installed

Step 2: Generate Certificates by Running mitmproxy
Running mitmproxy for the first time will generate the necessary SSL certificates:
mitmproxy --install

This command will generate the required mitmproxy-ca-cert.pem file in your ~/.mitmproxy/ directory.
Step 3: Locate the Certificate
Verify that the certificate has been generated:
ls ~/.mitmproxy/

You should see mitmproxy-ca-cert.pem in the list of files.
Step 4: Copy Certificate to System Trust Store
To make the certificate trusted system-wide, copy it to the appropriate directory and update the system’s certificates.

Copy the certificate to /usr/local/share/ca-certificates/:

sudo cp ~/.mitmproxy/mitmproxy-ca-cert.pem /usr/local/share/ca-certificates/mitmproxy-ca-cert.crt

Update the system's CA certificates:

sudo update-ca-certificates

This command updates the system’s trusted certificates, making the mitmproxy CA certificate trusted. If successful, you should see a message like:
Updating certificates in /etc/ssl/certs... 1 added, 0 removed; done.
Step 5: Verify Installation
Check the list of trusted certificates to ensure the mitmproxy certificate is now trusted:
ls /etc/ssl/certs | grep mitmproxy

Step 6: Restart Services (If Necessary)
Some services may require a restart to pick up the new certificate. For example, restart your browser or any service that uses SSL certificates.
Troubleshooting:

File permissions issue: If the certificate isn’t being recognized, ensure that the permissions on the file are correct:

sudo chmod 644 /usr/local/share/ca-certificates/mitmproxy-ca-cert.crt

Reinstall the certificate: If something goes wrong, delete the certificate and regenerate it by rerunning mitmproxy:

rm ~/.mitmproxy/mitmproxy-ca-cert.pem
mitmproxy --install

This will regenerate the mitmproxy-ca-cert.pem file.
Finally...
Quit the virtual environment:
deactivate


Add preliminary notes on how to release

Starting with the cumbersome OpenAPI transformations.

Good! I can’t merge it, so… can you merge or grant me permissions?

Good! I can’t merge it, so… can you merge or grant me permissions?

You've now got "maintain" access


How to run on frontend mode i.e. without NodeJs

@yohangz Thanks for the really cool seed project! I have read your article, great work! I still can't find a way to run it without NodeJs or how you mentioned it:

To summarize [frontend/localhost:4200] is only used for development purposes to run the application on watch mode with sbt run command. On run mode frontend can access all [backend/localhost:9000] services via a reverse proxy within Angular CLI.

I have tried doing the following but I get an error:
bravegag@Zeus:~/code/scala-play-angular-seed$ sbt "project frontend" run
[info] Loading global plugins from /home/bravegag/.sbt/1.0/plugins
[info] Loading settings for project scala-play-angular-seed-build from plugins.sbt ...
[info] Loading project definition from /home/bravegag/code/scala-play-angular-seed/project
[info] Loading settings for project root from ui-build.sbt,build.sbt ...
[info] Set current project to scala-play-angular-seed (in build file:/home/bravegag/code/scala-play-angular-seed/)
[error] Not a valid project ID: frontend (similar: root)
[error] project frontend
[error]                 ^

How to run it without NodeJs only using the Play backend <IP_ADDRESS>:9000?
It would be great if you could help with this one too:
https://stackoverflow.com/questions/56505853/scala-play-how-to-integrate-and-trigger-angular-7-components-from-view

@bravegag you can run the project via sbt run command.

@yohangz only running sbt run doesn't answer my question, that's the first thing I did. sbt run triggers JNode and runs it in <IP_ADDRESS>:4200 I am asking how to run without JNode.
Would you be interested in this?
https://www.upwork.com/ab/applicants/1138388509062459392/job-details

@bravegag it is mandatory to run NodeJs server in the background because we are using serve forntend and reverse proxy the backend service hosted via play server. All the details about this process are documented in the article.
I can't view that job details, seems like I'm not authorized.

@yohangz in another thread https://github.com/yohangz/scala-play-angular-seed/issues/2#issuecomment-365708496 you mentioned that the JsNode was optional and only required

on watch mode

Anyway, I realized that I'm after a different integration solution which corresponds in your article as:

2| Build both backend and frontend in the same project: Use scala views to expose frontend entry point and communicate with backend using the REST interface.
Pros:
Play activator associated commands (run, build, publish, etc..) to triggers frontend tasks associated (no need to worry how things get wired up).
No more CORS hassle, secure out of the box.
Easy CI/CD integration.

Cons:
Have to manage frontend code in multiple places (index html within scala views and rest of the code in frontend sub directory).
Development time experience is bad (Hard to get watch task working properly).
AoT build and other optimization implementation is hard.
No clear separation between frontend and backend code.
Frontend cannot be deployed in a CDN directly (It is technically feasible using a reverse proxy).

Do you have an Upwork account? would you like to make a new Seed that corresponds to your point #2 including Frontend cannot be deployed in a CDN directly (It is technically feasible using a reverse proxy).? I will help too (in addition to the paid work ofc).
This new solution seed for point 2 as I see it will require placing all Angular artifacts under app/assets and creating an angular system from scratch systemjs.config.js an example here<EMAIL_ADDRESS>This new solution seed can be a better mix of your article + https://github.com/joost-de-vries/play-angular-typescript.g8/tree/master/src/main/g8

@bravegag I wonder why you need such a solution instead of proposed. Please reach out to me via skype<EMAIL_ADDRESS>to discuss the details.


v3 Stable Release

This version aims to improve the API from that of v2 to resolve issues like:

API is not user-friendly, and clients are isolated to the server thread.
v2 requires a lot of thread locking to share information, which makes it a headache to use.
Overall v2 is not easy to use, nor is it elegant
Make use of rusts async model, and setup for https://github.com/NetrexMC/RakNet/issues/26

Current Changelog for v3

netrex_events has been dropped and you should use the newer Connection::recv_event() channel instead.

rakrs::start has been dropped, you should use rakrs::Listener::bind() in conjunction with rakrs::Listener::start() instead.

Every packet sent to the client is now exposed with Connection::recv() with the exception of the handshake sequence. This will allow you to write your own handlers for certain packets. However keep in mind, the protocol specific packets such as Ack, Nack, and disconnects are not exposed.

The internal module has been completely nuked and replaced with SendQueue and RecvQueue's.

Frame fragmentation is now more elaborate and elegant.

ACK, and NACK are now handled within their queues respectively, and follow a TimeRecoveryQueue.

Added TimeRecoveryQueue which is a queue with a max capacity. This queue is elegant and a packet within the queue will expire only if one of the following conditions is met:

The packet is pushed off the queue because newer packets have been added.

The packet has not been removed and it's been in the queue for too long of a duration.

Added RecoveryQueue which is a smart queue that will remove a index if and only if a newer packet is added that shifts the queue or if the retry attempts are greator than the value set within the queue, (which is 3 by default),

Please see: https://github.com/orgs/NetrexMC/projects/4 for a up to date road map.

🎉 🦀


Generated pipeline is not easy to diff.

I have two roughly similar properties (one stage and one prod) that I want to merge in a single pipeline. I created a new pipeline for each property and noticed from my diff that the JSON keys with the same values were often on different lines. e.g. :
"options": {
                "behavior": "MAX_AGE",
                "ttl": "1d",
                "mustRevalidate": false
            }

vs.
            "options": {
                "behavior": "MAX_AGE",
                "mustRevalidate": false,
                "ttl": "1d"
            }

Perhaps the lines could be sorted before the files are written to disk?

Thanks for bringing this to our attention.
This is an interesting problem!  We will look into a way to manage this!


⚠ Bofrost.de has degraded performance

In 936c4e3, Bofrost.de (https://www.bofrost.de) experienced degraded performance:

HTTP code: 200
Response time: 1015 ms

Resolved: Bofrost.de performance has improved in 75795f4 after 6 minutes.


2467: Delete offers tab

Short description

Delete the offers tab and purge all related components, files, types, screenshots and icons.
Proposed changes

Remove the dedicated route for offers and the corresponding types
Remove all components related
Remove the postData from OfferModel as we only support internal offers now (and set the zammad-url for the malteHelpOffer as path instead)
Remove screenshots with offers

Side effects

Old offer URLS do not work anymore

Resolved issues

Fixes: #2467.

Wow, thanks for slogging through that! Looks good already but in native I get an error about the imports of two Offers.svg files in native/src/constants/buildConfig.ts. Once I delete those, it looks good. (Also tested on Firefox)

Forgot to commit those o.O Good catch!

I also think that the docs for i18n and whitelabellingshould not mention the offers anymore.

done


Added SAML integration

Hi,
Hopefully you'll accept my change; happy to maintain my fork otherwise. This most recent change adds SAML support for single sign on using google or some other authorization provider.

I'm diverging plenty from your code base, and it seems like there isn't much interest for these fixes, so I'm repackaging and maintaining my own fork for now. If things change for you and you'd like to grab my changes, please let me know.


How to keep header when change tab?

When I change tab like video, it will move the header up and down
Version
"react": "18.2.0",
"react-native": "^0.70.6",
"react-native-collapsible-tab-view": "^5.0.0-rc.13",
"react-native-pager-view": "^6.1.2",
https://user-images.githubusercontent.com/31690470/228413590-fab31cc3-ddc0-4be2-b907-d7781283e4b4.mp4

@PedroBern How to fix it?

A repro that can be applied on the Example app in this repository would help.

Which version of the library? Can you reproduce this in the Example app in the repository?

@andreialecu Thank you for your quick reply. The problem I figured out is that I called jumpToTab() to the same active tab. It looks like:
const tabRef = useRef(null);
const [activeTabName, setActiveTabName] = useState("FirstTab");

return (
	<View style={{ flex: 1, backgroundColor: 'white' }}>
		<ScrollView contentContainerStyle={{ flexGrow: 1 }} scrollEnabled={false} horizontal={true}>
			<Tabs.Container
				ref={tabRef}
			...........
			renderTabBar={props => {
			         const {tabNames} = props;
			         return <View style={{flexDirection: 'row'}}>
				     <TouchableOpacity onPress={() => {
                                             // -----------> If you want to control tab event by yourself, you have to add judgment here.
					   if (activeTabName === tabNames[0]) {
					    	return;
					   }
					   tabRef.current.jumpToTab(tabNames[0]);
				     }}>
					 <Text>{tabNames[0]}</Text>
				    </TouchableOpacity>
				    <TouchableOpacity onPress={() => tabRef.current.jumpToTab(tabNames[1])}>
					 <Text>{tabNames[1]}</Text>
				    </TouchableOpacity>
			       </View>;
		        }}
			onTabChange={({tabName}) => setActiveTabName(tabName)}
			>
			<Tabs.Tab name={"FirstTab"} label={"label1"}>
				<Tabs.FlatList .../>
			</Tabs.Tab>
			<Tabs.Tab name={"SecondTab"} label={"label2"}>
				<Tabs.FlatList .../>
			</Tabs.Tab>
		</Tabs.Container>
	  </ScrollView>
   </View>
);

In a nutshell, just returns if the current tab is focused(active) and it's clicked again.
const goToTab = name => {
         // Condition here, if not, the header will scroll up to top automatically if you jump to the current tab focused!
	if (name === activeTab) {
		return;
	}
	// Jump to any tab you want here!
};

I'm having the same issue. It's hard to reproduce reliably, but I think it might have to do with changing tabs while a Tabs.FlatList is still rendering. I can do the same set of actions quickly and slowly, and fairly reliably the slow version works smoothly and the quick version janks the page around. This is using version 6.1.4, and a flatlist of 28 medium-complicated components (feed items). The feed items are making some API calls, but nothing that changes their size I believe, the image frame will be the same size whether there's an image there or not and the same thing happens when the feed items have no images.
Fast:
https://github.com/PedroBern/react-native-collapsible-tab-view/assets/14936307/47d3af3c-408d-41ab-82c8-316d90a1b2ff
Slow:
https://github.com/PedroBern/react-native-collapsible-tab-view/assets/14936307/e9e5ed90-9e1e-44ba-bb83-4c436cb33417
The basic code:
import React from 'react'
import { useColorModeValue } from 'native-base'
import {
  Tabs,
  MaterialTabBar,
  TabBarProps,
  TabProps,
} from 'react-native-collapsible-tab-view'

const tabBar = (props: TabBarProps) => {
  return (
    <MaterialTabBar
      {...props}
      indicatorStyle={{
        backgroundColor: useColorModeValue('#000000', '#ffffff'),
      }}
      labelStyle={{
        fontFamily: 'FavoritTrialStd-Light',
        fontSize: 14,
      }}
      tabStyle={{
        backgroundColor: useColorModeValue('#ffffff', '#000000'),
      }}
      activeColor={useColorModeValue('#000000', '#ffffff')}
      inactiveColor={useColorModeValue('#333333', '#dddddd')}
    />
  )
}

type TabViewProps = {
  header?: () => JSX.Element
  tabs: TabProps<string>[]
}

export const TabView = ({ header, tabs }: TabViewProps) => {
  return (
    <Tabs.Container
      renderHeader={header}
      renderTabBar={tabBar}
      allowHeaderOverscroll={true}
    >
      {tabs.map((tab) => (
        <Tabs.Tab name={tab.name} key={tab.name}>
          {tab.children}
        </Tabs.Tab>
      ))}
    </Tabs.Container>
  )
}

Facing the same issue, I reproduced from example directory. @dannykennedy I tried slow and quickly and don't think its related, its happening anyways.
https://github.com/PedroBern/react-native-collapsible-tab-view/assets/29123342/a14c9a99-237c-4782-9070-800fdec1a2d3
@andreialecu on some investigation, I found its due to lazy prop. If removed, it works fine.

Not only scrollable tabs, I'm also having same issue with custom tabbar in my project.
@andreialecu any work around to fix this?


Some keyboard shortcuts are written in two ways

VSCode Version: 1.15.1 -c[41abd21afdf7424c89319ee7cb0445cc6f376959]
OS Version: Windows 8.1 64-bit OEM (Home) SK

Steps to Reproduce:
https://s26.postimg.org/o6w2ttlex/screenshot_50.png

Reproduces without extensions: Yes

This should be tagged as Accessibility due to the impact differential placement, shading, and description by screen readers has on sight-impaired developers.

We will change to custom menus on Windows. For now you can set "window.titleBarStyle": "custom".

I think, shortcuts can have different colors that description of items in menu. Maybe as in native shortcuts can be lighter.


Build Zones cannot be Placed in Ceratin Areas

Build zone tiles cannot be placed in a few areas.

Fixed in latest release.


a "+sse4.2" function would not be able to safely call a "+sse3" function (it would need to be "+sse4.2,+sse3" instead). So even if you "just" do this, your code will probably still have a lot of unnecessary unsafe. Removing those would require introducing feature hierarchies (or similar).

I also like this proposal and think it should definitely be implemented at some stage (it bugs me that there are AArch64 NEON intrinsics in stdsimd that require unsafe, yet there are no AArch64 builtin targets in rustc without NEON enabled by default). Though, as @gnzlbg mentions, it is backward compatible so no hurry to do it now.

#[target_feature]s would need to be part of a function ABI/type signature/metadata/... for this to properly work across crates.

That's required now anyway unless cross crate calls are always going to use the lowest common denominator calling convention.
This also won't be able to be applied where the target features are unknown e.g., dynamic dispatch but that's not a big drawback. It just means functions with #[target_feature] will only be allowed to coerce into unsafe function pointers and trait methods with #[target_feature] will always have to be unsafe.

So I revise my preference to drop unsafe from the callee, because the unsafety isn't a property of the callee alone but a property of the caller-callee pair:

However, that is the normal case. Most if not all unsafe functions are safe to call in certain ways. In contrast, a function being "safe" means that it is safe to call in any well-typed way, by anyone.
So, I think it makes a lot of sense that a function which implicitly makes assumptions about the instruction set of the CPU should be unsafe. This function is not safe to call anytime, anywhere. Rather, similar to get_mut_unchecked, it requires the caller to do some checking before being called.

@RalfJung I think we could phrase #[target_feature] fn as sugar for #[target_feature] unsafe fn but with two twists:

to call any unsafe code from those functions the user would need to write an explicit unsafe block,
this unsafe block would not be necessary for other #[target_feature] functions that the compiler can prove are safe to call from that context (and if the compiler cannot prove it, then the user would need to explicitly write unsafe).

In code:
#[target_feature = "+sse4.2"] fn foo_sse42();
#[target_feature = "+avx"] fn bar_avx();
unsafe baz();

#[target_feature = "+sse4.2"]
fn meow() {
    foo_sse42(); // OK: compiler can prove this safe
    bar_avx(); // ERROR: unsafe fn
    baz(); // ERROR: unsafe fn
}

where meow desugars to:
#[target_feature = "+sse4.2"]
unsafe fn meow() {
    safe {  // only safe code allowed
        foo_sse42(); // OK: compiler can prove this safe
        bar_avx(); // ERROR: unsafe fn
        baz(); // ERROR: unsafe fn
    }
}

where safe would open a safe code block that disallows any use of unsafe.

In contrast, a function being "safe" means that it is safe to call in any well-typed way, by anyone.

The "well-typed" thing is the key. In order to avoid unsafe proliferation that makes the safe/unsafe distinction less useful that could be, the set of instruction set extensions a function is compiled with should be viewed as part of its type for the purpose of determining whether a call is allowed.
Like the type of the arguments imposes a precondition the caller has to satisfy when calling safe functions, the set of instruction set extensions should be viewed as a precondition that the caller has to satisfy for the call to be safe. However, unlike the type checking of arguments, which can't be waived with unsafe, an unsafe block would waive the enforcement of the callee having a subset (including equal) of the instruction set extensions relative to the caller.
In general, I think this issue should be analyzed from the perspective of avoiding impractical results that damage the unsafe/safe distinction of Rust. That is, if mechanical application of precedent yields undesirable results, instead of just going with the undesirable conclusion, it's worthwhile to consider if the description of precedent could be amended somehow. (In this case, by observing that the instruction set extensions that apply should be viewed as a type-like constraint.)

@hsivonen

Therefore, in order to avoid everything becoming unsafe and unsafe/safe distinction getting less useful as a result, the rule that only a callee marked unsafe can cause the requirement for an unsafe block to be used to call it be relaxed: In addition, an unsafe block is needed to call a function not marked unsafe if the callee has target_features that the caller doesn't have.

Like the type of the arguments imposes a precondition the caller has to satisfy when calling safe functions, the set of instruction set extensions should be viewed as a precondition that the caller has to satisfy for the call to be safe. However, unlike the type checking of arguments, which can't be waived with unsafe, an unsafe block would waive the enforcement of the callee having a subset (including equal) of the instruction set extensions relative to the caller.

Both of these statements are very similar to my own views on the matter. One can even go a step further and allow safe calling of target_feature fn's inside contexts where you know the target via a cfg macro or cfg attribute. However, I think all of this can be done as a refinement. Remember, right now Rust has no target feature at all :). See this as a first step!

This almost sounds like having an "unsafe_{if,unless}" feature, or safety preconditions/effects.
The only tricky bit seems to be scoping an assumption for unsafety/effect checking.
cc @nikomatsakis I believe the old typestate system had some similarities?

@eddyb yes is a bit novel because you'd have to do some control flow analysis for the feature (for reference, what I want is to have fn_without_target_feature() { if cfg!(target_feature = "avx") { fn_that_has_target_feature(...) } } to not require unsafe).
Now cfg macros and attributes are evaluated statically, so combining them with functions with target_feature attributes is not really useful. However, one can also consider safe calling support for some dynamic dispatch mechanism, whether it is matching on the result of some lang item function, or something function pointer based with some automation provided by the language.

What if target_feature is kept unsafe, but it is used only for constructing a zero-sized struct that has the target platform API as static methods that are safe to call. This way the type system guarantees safety.

What you propose sounds in general like a good idea, I encourage you to write an RFC that explores that and please ping us here once you have a draft!

I wrote a draft.

@hsivonen the RFC or the unresolved questions section should mention
function pointers and trait methods (e.g calling a target feature function
via a trait object).
If you phrase that as an improvement over the current proposal, you might
get away with just falling back to having to annotate those with unsafe
(that is, your RFC would improve most cases, but for function pointers and
trait methods we would need an improvement over that).
Also it might be worth to point if there are any issues in this RFC that
would make improvements like the one you propose to require a backward
incompatible change.
@est31
'if cfg_feature_enabled!("sse4.1") { ... }'
Could expand to:
'if __runtime_detection("sse4.1") #[safe(target_feature = "sse4.1")] { ...
}'
allowing us to remove the need for unsafe in those blocks (but we would
need to allow attributes in more positions).
On Tue 7. Nov 2017 at 13:11, Henri Sivonen<EMAIL_ADDRESS>wrote:

What you propose sounds in general like a good idea, I encourage you to
write an RFC that explores that and please ping us here once you have a
draft!
I wrote a draft
https://github.com/hsivonen/rfcs/blob/minimal-target-feature-unsafe/text/0000-minimal-target-feature-unsafe.md
.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/rust-lang/rfcs/pull/2045#issuecomment-342464128, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA3NpstR0Cb-f4QCHfvgQgdx25fU1O2-ks5s0EkAgaJpZM4OFlXl
.

@gnzlbg :

the RFC or the unresolved questions section should mention function pointers and trait methods (e.g calling a target feature function via a trait object).

Thanks. I covered those and created a PR.


Make use of intern! macro for attribute names used internally

Since we do use several attribute names internally, I looked into whether some of them could be candidates for interning. Personally, I do not think this is obvious as while identifiers like __name__ will most likely already be part of Python's string interner dictionary, they do not seem to be used in a hot path of PyO3.
I therefore split this into separate commits to solicit feedback on whether we want to include any of them:

__qualname__ used in PyType::name. Here, I am not sure how often production code using PyO3 actually calls this.
__all__ and __name__ used in the implementation of PyModule. This seems to be limited to initialization, but the strings are almost surely interned already by other code.
The the attribute names used in getattr calls emitted by the FromPyObject derive macro. I think this has the largest possible benefit as this could end up being used in every Python-to-Rust call. But I am also not sure whether enabling this unconditionally is a good idea. (Since the names are given via code and not generated dynamically, this should be ok?)

Related idea: add a comment to getattr/setattr recommending intern!?

Related idea: add a comment to getattr/setattr recommending intern!?

Add a comment to the methods of Py and PyAny. Would be glad for feedback on the wording. I think linking the PyDict example given at intern!'s docs is sufficient or should I add a getattr-specific one?

I think an example would not go amiss.

Added a single example to each of the four cases.

Thanks a lot!


(A) link in code not useful

The (A) link in the left source code gutter would be so much more useful if it linked to the GraphQL file, rather than the home page for the Apollo web site.

Hi Rich.
Which GraphQL file do you mean?
Thanks,
Jim.

Closing due to missing reply.


Schema validation for deprecated tags

In score_1.0.0, the tag 'Motor-onset-seizure' was deprecated, but its children were not removed.
Deprecated tags should not have active children, so I suggest adding this to the schema validation tool as an error.

This has been added in the current validation.


A tiny Typo discovered

Under the section Scaffold the Instructor Model
https://docs.microsoft.com/en-us/aspnet/core/data/ef-rp/read-related-data?view=aspnetcore-2.0#scaffold-the-instructor-model
Towards the lower part of this section when referring to the "OnGetAsync" method having two includes, it instructs the user to:
"Examine the query on the Pages/Instructors/Index.cshtml page:"
This should actually read:
"Examine the query on the Pages/Instructors/Index.cshtml.cs page:"
Just the ".cs" is missing from the filename.  Probably not something that will throw many people off.
Thank you again for all of your tutorials!  They are proving to be a valuable resource for my learning.

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

ID: d0026f69-7e5d-0d3e-5586-16ecc0656ff0
Version Independent ID: 3cb264da-2ff1-1256-572f-aa4ebca6e255
Content: Razor Pages with EF Core in ASP.NET Core - Read Related Data - 6 of 8
Content Source: aspnetcore/data/ef-rp/read-related-data.md
Product: asp.net-core
GitHub Login: @Rick-Anderson
Microsoft Alias: riande

Thanks @yamazaroon ... I'll patch that up right now.


let's remove most of Constants.jl and URL.jl

These make the code more difficult to read. That level of abstraction does not seem necessary, especially for things like EMPTY_STRING = "". Similarly about the URLs -- almost of of these are used in a single location -- it would be much easier to read the code if the actual URL is present, instead of a constant.
Generally I am leaning towards minimizing boilerplate and abstraction until something is repeated three times (two repetitions are not really worth spending the effort of abstracting away (a vague rule of thumb))

Thank you for the feedback, I will fix this in upcoming PR.


Connection Issues

Hi,
I am having trouble to connect a Scanner/Scale combo using RS232 Single Cable to a PC and found your repo. For me the normal RS232 Interface is working fine and I can communicate with this interface. But I have to use the RS232 Single Cable Interface like you. I receive the label data but can not start the weight measurement. I have 2 questions:

I found this in your code. Is it required?

            this._serialPort.RtsEnable = true;
            this._serialPort.DtrEnable = true;

Where did you find the documentation of the command set for the single cable interface?

Greetings and thank you for your work

Hi @TheDelus
See attached scanner scale protocol summary doc that i received from DataLogic.
From the documentation you can see that it says that it requires hardware handshaking so I have replaced
this._serialPort.RtsEnable = true;
this._serialPort.DtrEnable = true;
with
this._serialPort.Handshake = Handshake.RequestToSend;
Please see PR - I have created a new release and also pushed to Nuget v1.0.2 - please check it and let me know if it works for you.
Please note that this is only tested/certified for use with 9xxx series e.g. 9800 / 9300. Can you confirm what scale model you are using?

Hi @brendangooden
I cant find the scanner scale protocol summary. Where is it? Can you add it to the repo?

@TheDelus Sorry here it is.

Hi @TheDelus  Did the new update fix the issue for you?

Hi, yes I can confirm that its working. It is even working with a Datalogic 8400 Scanner/Scale.


Bug/16

Short Description
Fixes issue #16 . After this PR parameters are provided by the user without surrounding ' ', e.g.:
"parameters": {
"Oracle": "(A | B) & (A | ~B) & (~A | B)",
"token": "..."
},
Proposed Changes

detection of numeric literals with regex
otherwise add ' ' for correct Prolog execution

Fixes: #16

checks are failing


[Bug]: JavaScript parsing error: 'import', and 'export' cannot be used outside of module code

System Info
system: macos 15.0
node: 20.16.0
Details
rspack.zip
操作步骤：

解压附件文件
npm i
node pack.js

JavaScript parsing error: 'import', and 'export' cannot be used outside of module code
问题：
mode: "development" 正常
mode:  "production", 报错

Reproduce link
No response
Reproduce Steps
see details

Rspack uses the SwcJsMinimizerRspackPlugin by default to compress code, and you may need to configure the minimizerOptions to set module to true.

Rspack uses the SwcJsMinimizerRspackPlugin by default to compress code, and you may need to configure the minimizerOptions to set module to true.

this is not the best solution since it will cause all js assets are treated module, you can control specific assets by set assetInfo
 compilation.updateAsset(entry, new ConcatSource(
          `export default function(global, globalThis, window, $app_exports$, $app_evaluate$){`,
          source,
          `}`
        ), {
          javascriptModule:true // set this asset as module
  });

should be fixed in #7924

Rspack uses the SwcJsMinimizerRspackPlugin by default to compress code, and you may need to configure the minimizerOptions to set module to true.

this is not the best solution since it will cause all js assets are treated module, you can control specific assets by set assetInfo
 compilation.updateAsset(entry, new ConcatSource(
          `export default function(global, globalThis, window, $app_exports$, $app_evaluate$){`,
          source,
          `}`
        ), {
          javascriptModule:true // set this asset as module
  });

but rspack has some bugs about dealing with assetInfo, I'm gonna fix it

should be fixed in should be fixed in #7924


libbpf: Added AttachXDP wrapper

https://github.com/aquasecurity/libbpfgo/issues/171

Hi @guyarb! My apologies for the delay in review, I was off all of last week. I'll be looking at this today.

I manually tested this and of course it works great, thanks for submitting! Just a comment and a question. I'd like to have a selftest for this but because it'll require an external program it can get complicated, not going to ask that of you.

I copied the selftest from tc and modified it accordingly
Ran it locally and it worked
If I made anything wrong in the selftest - please let me know!

Thank you @guyarb !


Unable to create new IBC channels with Osmosis

The Problem:
I can't seem to create new IBC channels between Osmosis <-> { Dig, Odin }; I've tried Hermes, Go rly, and TS-relayer (though TS-relayer never really worked in the past either), and they all fail with some sort of error on the Osmosis side. Others also reported the same issues in the IBC Telegram channel when they tried to create new IBC channels between Osmosis <-> { Lum, Chihuahua }. Someone was able to create channels between Chihuahua <-> Bitsong though using Hermes. Note that we are all trying this after the Osmosis v5 upgrade (see also Other Observations at the end). We're all experiencing the following (using Dig as example):
Hermes (same results using v0.8.0 and 0.9.0):
hermes create channel dig-1 osmosis-1 --port-a transfer --port-b transfer

Client creation and init connection happens, and then gRPC call failed with status: status: Unknown, message: "recovered: parameter UnbondingTime not registered error. Full error below:
2021-12-16T03:20:06.055394Z ERROR ThreadId(21) [osmosis-1] estimate_gas: failed to simulate tx with non-recoverable error: gRPC call failed with status: status: Unknown, message: "recovered: parameter UnbondingTime not registered\nstack:\ngoroutine 10606463 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x65\ngithub.com/cosmos/cosmos-sdk/baseapp.newDefaultRecoveryMiddleware.func1({0x198a5c0, 0xc11c2e3a00})\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/baseapp/recovery.go:71 +0x27\ngithub.com/cosmos/cosmos-sdk/baseapp.newRecoveryMiddleware.func1({0x198a5c0, 0xc11c2e3a00})\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/baseapp/recovery.go:39 +0x30\ngithub.com/cosmos/cosmos-sdk/baseapp.processRecovery({0x198a5c0, 0xc11c2e3a00}, 0xc000547680)\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/baseapp/recovery.go:28 +0x37\ngithub.com/cosmos/cosmos-sdk/baseapp.processRecovery({0x198a5c0, 0xc11c2e3a00}, 0x2606fa0)\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/baseapp/recovery.go:33 +0x5e\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx.func1()\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/baseapp/baseapp.go:598 +0xfd\npanic({0x198a5c0, 0xc11c2e3a00})\n\truntime/panic.go:1038 +0x215\ngithub.com/cosmos/cosmos-sdk/x/params/types.Subspace.checkType({{0x0, 0x0}, 0x0, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0, 0x0}, ...}, ...)\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/x/params/types/subspace.go:153 +0x179\ngithub.com/cosmos/cosmos-sdk/x/params/types.Subspace.Get({{0x0, 0x0}, 0x0, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0, 0x0}, ...}, ...)\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/x/params/types/subspace.go:103 +0x9e\ngithub.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper.UnbondingTime(...)\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/x/staking/keeper/params.go:12\ngithub.com/cosmos/ibc-go/v2/modules/core/02-client/keeper.Keeper.ValidateSelfClient({{0x25a2690, 0xc000d5e550}, {0x2601df8, 0xc006a04470}, {{0x2601df8, 0xc006a04470}, 0xc000020088, {0x25a2690, 0xc000d5e540}, {0x25a26e0, ...}, ...}, ...}, ...)\n\tgithub.com/cosmos/ibc-go/v2@v2.0.0/modules/core/02-client/keeper/keeper.go:310 +0x415\ngithub.com/cosmos/ibc-go/v2/modules/core/03-connection/keeper.Keeper.ConnOpenTry({{0x0, 0x0}, {0x25a2690, 0xc000d5e550}, {{0x2601df8, 0xc006a04470}, 0xc000020088, {0x25a2690, 0xc000d5e540}, {0x25a26e0, ...}, ...}, ...}, ...)\n\tgithub.com/cosmos/ibc-go/v2@v2.0.0/modules/core/03-connection/keeper/handshake.go:124 +0x6c5\ngithub.com/cosmos/ibc-go/v2/modules/core/keeper.Keeper.ConnectionOpenTry({{0x0, 0x0}, {0x2601df8, 0xc006a04470}, {{0x25a2690, 0xc000d5e550}, {0x2601df8, 0xc006a04470}, {{0x2601df8, 0xc006a04470}, ...}, ...}, ...}, ...)\n\tgithub.com/cosmos/ibc-go/v2@v2.0.0/modules/core/keeper/msg_server.go:168 +0x545\ngithub.com/cosmos/ibc-go/v2/modules/core/03-connection/types._Msg_ConnectionOpenTry_Handler.func1({0x25da038, 0xc0d8e08480}, {0x1bc7a20, 0xc074cb2100})\n\tgithub.com/cosmos/ibc-go/v2@v2.0.0/modules/core/03-connection/types/tx.pb.go:584 +0x78\ngithub.com/cosmos/cosmos-sdk/baseapp.(*MsgServiceRouter).RegisterService.func2.1({0x25da038, 0xc0d8e08450}, {0x4ba1e6, 0x41108b}, 0x1c41180, 0xc0b8c1f038)\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/baseapp/msg_service_router.go:113 +0xd5\ngithub.com/cosmos/ibc-go/v2/modules/core/03-connection/types._Msg_ConnectionOpenTry_Handler({0x1c35940, 0xc0001d6f00}, {0x25da038, 0xc0d8e08450}, 0x23674d8, 0xc0ad1f4160)\n\tgithub.com/cosmos/ibc-go/v2@v2.0.0/modules/core/03-connection/types/tx.pb.go:586 +0x138\ngithub.com/cosmos/cosmos-sdk/baseapp.(*MsgServiceRouter).RegisterService.func2({{0x25d9fc8, 0xc000052070}, {0x2606fa0, 0xc074cbc2c0}, {{0xb, 0x1}, {0xc12ecfe510, 0x9}, 0x24abb8, {0x23097927, ...}, ...}, ...}, ...)\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/baseapp/msg_service_router.go:117 +0x34f\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runMsgs(_, {{0x25d9fc8, 0xc000052070}, {0x2606fa0, 0xc074cbc2c0}, {{0xb, 0x1}, {0xc12ecfe510, 0x9}, 0x24abb8, ...}, ...}, ...)\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/baseapp/baseapp.go:719 +0x46a\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx(0xc0006031e0, 0x2, {0xc0b4256000, 0x2733, 0x2800})\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/baseapp/baseapp.go:679 +0xa2c\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).Simulate(...)\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/baseapp/test_helpers.go:22\ngithub.com/cosmos/cosmos-sdk/x/auth/tx.txServer.Simulate({{{0x0, 0x0, 0x0}, {0x2618fb0, 0xc0881ab740}, {0xc0012d48c0, 0x9}, {0x25e3850, 0xc0011ae540}, {0x260c958, ...}, ...}, ...}, ...)\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/x/auth/tx/service.go:117 +0x129\ngithub.com/cosmos/cosmos-sdk/types/tx._Service_Simulate_Handler.func1({0x25da038, 0xc0c51e65a0}, {0x1bad840, 0xc07d99aac0})\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/types/tx/service.pb.go:752 +0x78\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).RegisterGRPCServer.func1({0x25da038, 0xc09e1bb6b0}, {0x1bad840, 0xc07d99aac0}, 0xc07d99ab20, 0xc0c7e5eca8)\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/baseapp/grpcserver.go:66 +0x40d\ngithub.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1({0x25da038, 0xc09e1bb6b0}, {0x1bad840, 0xc07d99aac0})\n\tgithub.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:25 +0x3a\ngithub.com/grpc-ecosystem/go-grpc-middleware/recovery.UnaryServerInterceptor.func1({0x25da038, 0xc09e1bb6b0}, {0x1bad840, 0xc07d99aac0}, 0x18, 0xc07d99ab20)\n\tgithub.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/recovery/interceptors.go:33 +0xc8\ngithub.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1({0x25da038, 0xc09e1bb6b0}, {0x1bad840, 0xc07d99aac0})\n\tgithub.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:25 +0x3a\ngithub.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1({0x25da038, 0xc09e1bb6b0}, {0x1bad840, 0xc07d99aac0}, 0xc0c4d98b01, 0xc0c4d98b58)\n\tgithub.com/grpc-ecosystem/go-grpc-middleware@v1.3.0/chain.go:34 +0xbf\ngithub.com/cosmos/cosmos-sdk/types/tx._Service_Simulate_Handler({0x1b530e0, 0xc09575c680}, {0x25da038, 0xc09e1bb6b0}, 0xc111564660, 0xc09e1bb710)\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/types/tx/service.pb.go:754 +0x138\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).RegisterGRPCServer.func2({0x1b530e0, 0xc09575c680}, {0x25da038, 0xc09e1bb6b0}, 0x1c03440, 0xc0691e0900)\n\tgithub.com/cosmos/cosmos-sdk@v0.44.3/baseapp/grpcserver.go:80 +0xdc\ngoogle.golang.org/grpc.(*Server).processUnaryRPC(0xc095760000, {0x25f66e0, 0xc0000fd680}, 0xc0691e0900, 0xc0957649f0, 0xc088afcfc0, 0x0)\n\tgoogle.golang.org/grpc@v1.42.0/server.go:1210 +0xc8f\ngoogle.golang.org/grpc.(*Server).handleStream(0xc095760000, {0x25f66e0, 0xc0000fd680}, 0xc0691e0900, 0x0)\n\tgoogle.golang.org/grpc@v1.42.0/server.go:1533 +0xa2a\ngoogle.golang.org/grpc.(*Server).serveStreams.func1.2()\n\tgoogle.golang.org/grpc@v1.42.0/server.go:871 +0x98\ncreated by google.golang.org/grpc.(*Server).serveStreams.func1\n\tgoogle.golang.org/grpc@v1.42.0/server.go:869 +0x294\n: panic", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc", "x-cosmos-block-height": "2403256"} }

Go rly (following https://github.com/notional-labs/notional/blob/master/relaying/rly/Readme.md):
rly tx link digosmo -d -o 300s

The command times out after about 10s, spits out the following error (I'm running this on an Osmosis node and so the RPC is at localhost), and jams the Osmosis node for a couple minutes:
I[2021-12-16|05:13:36.314] - [osmosis-1] -> creating client on osmosis-1 for dig-1 header-height{28983} trust-period(168h0m0s)
I[2021-12-16|05:13:46.410] Error: querying clients on osmosis-1 failed: post failed: Post "http://localhost:26657": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
I[2021-12-16|05:13:56.412] - [osmosis-1] -> failed sending transaction:
{"client_state":{"@type":"/ibc.lightclients.tendermint.v1.ClientState","chain_id":"dig-1","trust_level":{"numerator":"1","denominator":"3"},"trusting_period":"604800s","unbonding_period":"1209600s","max_clock_drift":"600s","frozen_height":{"revision_number":"0","revision_height":"0"},"latest_height":{"revision_number":"1","revision_height":"28983"},"proof_specs":[{"leaf_spec":{"hash":"SHA256","prehash_key":"NO_HASH","prehash_value":"SHA256","length":"VAR_PROTO","prefix":"AA=="},"inner_spec":{"child_order":[0,1],"child_size":33,"min_prefix_length":4,"max_prefix_length":12,"empty_child":null,"hash":"SHA256"},"max_depth":0,"min_depth":0},{"leaf_spec":{"hash":"SHA256","prehash_key":"NO_HASH","prehash_value":"SHA256","length":"VAR_PROTO","prefix":"AA=="},"inner_spec":{"child_order":[0,1],"child_size":32,"min_prefix_length":1,"max_prefix_length":1,"empty_child":null,"hash":"SHA256"},"max_depth":0,"min_depth":0}],"upgrade_path":["upgrade","upgradedIBCState"],"allow_update_after_expiry":true,"allow_update_after_misbehaviour":true},"consensus_state":{"@type":"/ibc.lightclients.tendermint.v1.ConsensusState","timestamp":"2021-12-16T05:13:28.228579687Z","root":{"hash":"GC1O3kQJJFa1H6xn6kn3+MeW5kW57Rty8zbM+hqHTys="},"next_validators_hash":"3856D07BAA91CC8647C1BCBC886D0FCD5575AC18892E8FE643CB5291E937A9B3"},"signer":"osmo1xxwu8gcx64wlrnlwap433hltz8e2pmq4gxph2f"}
E[2021-12-16|05:13:56.413] - [osmosis-1] -> err(post failed: Post "http://localhost:26657": context deadline exceeded (Client.Timeout exceeded while awaiting headers))
Error: post failed: Post "http://localhost:26657": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

Other Observations:
Someone else tried to create new channels between Osmosis <-> Odin a couple days ago (prior to the Osmosis v5 upgrade) and encountered a different error. Today (after the Osmosis v5 upgrade) when I tried it, I get the error above instead like everyone else for other chains, so maybe the Osmosis upgrade has something to do with it.

On our side (Lum Network) w've been unable to create paths as well.
Always ended up with timeout exception

In addition to that:
While chihuahua <> bitsong is working it's not possible to establish a new channel between bitsong <> osmosis. It returns the exact same error

What are the hermes and go relayer versions used? We used the default parameters for IBC connections in v1, https://github.com/cosmos/ibc-go/blob/main/modules/core/03-connection/types/params.go, which allows 30 second block times. So I feel like that shouldn't be the issue

What is the go relayer versions used?

For me I was using hermes

Looking at the error here:

It looks like UnbondingTime isn't registered which is a parameter of the staking module that the connection keeper uses.
https://github.com/cosmos/ibc-go/blob/main/modules/core/03-connection/keeper/handshake.go#L124
https://github.com/cosmos/ibc-go/blob/2273ef39fd461eb2c5977a8dcaa16e44a4e97251/modules/core/02-client/keeper/keeper.go#L310
So my guess is that this is an issue with how the app is wired up.
I believe the staking keeper that is passed into the clientkeeper does not have its parameters registered correctly.
This reminds me of a similar problem I had in interchain-security. See these commits:
https://github.com/cosmos/interchain-security/pull/25/commits/a54d1374a6e72f2b85aabef45f540bc1de9fa5fc
https://github.com/cosmos/interchain-security/pull/25/commits/368b5116e63ec93d0fbf5e934737a2a46d7d30b1
I don't know if those commits help. But i would look to see if there's potentially an issue of IBC receiving the staking keeper before the parameters are registered in app.go

I would try moving this line: https://github.com/osmosis-labs/osmosis/blob/main/app/app.go#L481
above the IBC Keeper creation and see if it works

Hoods shouldn't be what sets params

Yea but i think you're replacing the staking keeper here. Annoying pointer issue i think

It looks like the IBC Keeper is being passed the uninitialized staking keeper since the staking keeper is created as a variable and not set to app.StakingKeeper
https://github.com/osmosis-labs/osmosis/blob/0af385c652ac93aac5826813bd7ae992248494b9/app/app.go#L329
https://github.com/osmosis-labs/osmosis/blob/0af385c652ac93aac5826813bd7ae992248494b9/app/app.go#L440

Ahh yea, i think colin's correct

app.go is by far the worst part of cosmos developer ux

Agggghhhhh
That's so annoying.  Yeah...  That seems likes it's probably it.

Since the StakingKeeper params are not accessible to the IBC Keeper, no connection handshake can succeed until the fix is upgraded to. That is the extent of the damage. Existing clients/connections can continue to be maintained and packet flow won't be disrupted.
We use the staking params, UnbondingTime and GetHistoricalInfo. UnbondingTime is used for self verification of the client state in ConnOpenTry/Ack and GetHistoricalInfo is used for self verification of the consensus state in ConnOpenTry/Ack.
We will add defensive checks to our codebase to hopefully avoid a reoccurence of this issue

Fixed in upgrade


MachInst isel and aarch64 backend: docs / clarity improvements.

From discussion with Julian and Ben, this PR makes a few documentation-
and naming-level changes (no functionality change):

Document that the LowerCtx-provided output register can be used as a
scratch register during the lowered instruction sequence before
placing the final result in it.

Rename input_to_* helpers in the AArch64 backend to
put_input_in_*, emphasizing that these are side-effecting helpers
that potentially generate code (e.g., sign/zero-extensions) to ensure
an input value is in a register.

Will go ahead and merge but see above; not forgetting the suggestions as I think they'll be useful later. Thanks!


Mockup request: Jurisdiction editor to specify new regions

Sovereign currently allows for Nation-States to be expressed as jurisdictions.
Custom made jurisdictions based on cities, regions, trade unions can also be included in the system to enable ambassadors of Democracy Earth to post new ideas that can be restricted to a specific universe of voters.
Mockups for this editor are required.

is there any way that students from a university for example can ensure that only relevant members (other students) are participating in their "jurisdiction", so they can be assured of the validity of the polls?

@santisiri does there need to be a data model for this?
Let's say users of Facebook wanted to vote on a new feature, how would they all be grouped in a data model, apart from simply as verified Facebook users? They would still have to prove their identities (i.e. being users of Facebook) but they would certainly range across a whole plethora of geographies. Another example, what if the Oscars wanted to do their voting with Sovereign?
My point being, I am not sure it is even possible to create a data model. Please tell me if my thoughts are completely off track!
Perhaps it might be better to allow users to define whatever identity requirements they would like for an organisation, and leave it at that? Although I admit, the challenge of proving identities with an ever shifting set of requirements is making my brain hurt.

Okay, let's try to break this apart @AlexJupiter for the sake of clarity.
As Sovereign is right now, we only have attached to users their jurisdiction in a geographical sense (Nationality). So that could be used to filter down proposals that where written by all those users that belong to Nation X.
A different model is the idea of hashtags (which we now also support). A hashtag like #MeToo or #BlackLivesMatter can very well be an organization in the system. So we could filter down posts with that tag or also even posts with that tag written by members of a certain nationality.
If an organization wants to be represented in the system, it can create an account on its behalf: "University of Cambridge" could simply be a different user in the system. The thing is how we verify this entity or whether we make a distinction between individual users and organizations.
I think that we need to understand also how we play with the rules and possibilities already embedded in the current data model we have, just to keep things simple to implement.

I'll make a mockup of the ultra lean approach I've been proposing.

As Sovereign is right now, we only have attached to users their jurisdiction in a geographical sense (Nationality). So that could be used to filter down proposals that where written by all those users that belong to Nation X.

Makes sense.
However, I think it's important to understand why a user would join an organisation, and why they would use a hashtag.
My predictions (and please disagree) are:

As a user I would join an organisation to allow me to work with a group of people for a particular purpose
As a user I would use a hashtag to allow me to attach my ballot to a campaign and/or increase the exposure of my ballot

If these user stories are correct, in this sense, a hashtag can exist independently from an organisation. And even if the #MeToo hashtag is used, this might not be related to that specific organisation. Hashtags quite often take on a meaning of their own and to restrict their usage could be problematic.
From this above reasoning, I suggest that organisations and hashtags are kept very separate. Therefore, a user can be verified to join an organisation, however any user can use any hashtag.
Does that reasoning make sense? 🤔

If an organization wants to be represented in the system, it can create an account on its behalf

Perhaps, but I worry that this could create a centralised authority for the manifestation of that organisation on Sovereign. For example, who is in control of that account? An organisation/group that verified people can join, and then anyone can propose a ballot in, seems a much better solution in my view.

I think that we need to understand also how we play with the rules and possibilities already embedded in the current data model we have, just to keep things simple to implement.

I get the desire to keep the implementation simple, however from the above reasoning (of which I encourage disagreement), I feel that the implementation of an organisation (implemented very similar to a Facebook Group) is the path forward.

My inclination to design is to crave for simplicity as much as we can.

Perhaps, but I worry that this could create a centralised authority for the manifestation of that organisation on Sovereign. For example, who is in control of that account? An organisation/group that verified people can join, and then anyone can propose a ballot in, seems a viable alternative as a result.

Any organization is a hub and by consequence a centralized point.
The reason I like marrying the idea of hashtags and organizations is the following: when you look at the dynamics of a liquid democracy, it plays out in the same way a marketplace does. In the marketplace, there is such a thing that is analogous to hashtags, we call them brands over there. People connect to brands either to represent their lifestyle or, a more fanatical minority even to directly work for them (influencers, employees, etc).
I would argue that a hashtag is simply a namespace in the same way a domain is on the web. I think that people can own a hashtag and turn it into an organization (and hence establish its membership criteria) and as it's also a messaging device (afterall #hashtags is branding), also be used to communicate an idea.
Doing facebook groups is redundant, costly, tedious and complex.

As referenced on #250, I'll put this as a strategic goal for version 1.0.0 so we keep current milestone with a manual implementation of jurisdictions to test and focused on making sovereign more social-media-like.


how to know which augmenters are used?

hi~,
i want to know when i use (Someof), how to know which augmenters are used?
thank you very much!
and i got a problem it seem like that
error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\core\src\alloc.app:72:error(-4:Insufficient memory) Failed to allocate ***** bytes in function 'cv::OutofMemoryError'

Take a look at this post https://github.com/aleju/imgaug/issues/275#issuecomment-468907493; @aleju mentions a way to determine which augmenters are used in a SomeOf() block.
As for the OpenCV error, the obvious question is "are you doing something that might exceed your free memory"?

Take a look at this post #275 (comment); @aleju mentions a way to determine which augmenters are used in a SomeOf() block.
As for the OpenCV error, the obvious question is "are you doing something that might exceed your free memory"?

thank you very much


Thank you!

I just wanted to say thank you for this awesome piece of software. It has changed the way we do pair and mob programming in my team. Thank you that you're investing your time to build this!
(Feel free to close this right away)

That makes my day, thanks @britter! That's fantastic that your team is getting value from Mobster.
I'm curious, what are the things that have improved your team's experience of mobbing/pairing? And is there anything that would make the experience even better?
Cheers,
Dillon

I'm curious, what are the things that have improved your team's experience of mobbing/pairing?

Well to be honest, we weren't really doing pair programming. We always did it like two people sitting at a machine hacking together. Mobster helped us really to follow the process: It makes clear who is driver and who is navigator. It enforces time boxes. And it makes sure you take a break once in a while :-)

And is there anything that would make the experience even better?

I realized, that we don't really pay attention to committing our code to SCM. So I wonder whether Mobster can help enforcing regular commits. The problem with this is, that sometime your timebox ends while you're in the middle of writing a test. This is probably something we have to pay more attention to, but I wonder whether there is something Mobster can do to help with this. For example run all the tests when the timebox ends and then blame the team if there is something failing. If everything is green it could just commit it. This may turn out to be complicated since mobster would have to know who to run tests...

Wow, so great to hear that Mobster has helped with those things! So how did your team discover it then, was it recommended or searched for?
By the way, I'm not sure if you've looked at the tips in Mobster yet, but this article helped my pairing and mobbing tremendously: http://llewellynfalco.blogspot.com/2014/06/llewellyns-strong-style-pairing.html

So how did your team discover it then, was it recommended or searched for?

Some guys at my company have used it and they recommended it. So we gave it a try :-)

By the way, I'm not sure if you've looked at the tips in Mobster yet, but this article helped my pairing and mobbing tremendously: http://llewellynfalco.blogspot.com/2014/06/llewellyns-strong-style-pairing.html

Thank you, I'll definitely have a look!

Neat, great to hear from you. Feel free to let me know if you have any suggestions in the future. And thanks for the feedback!


cmd/gb: add tag key to depfile

Add a new depfile key, tag which is an unadorned github release tag.

But some projects  didn't   have tags

Then they need to start making them, and you need to push them to do so. http://dave.cheney.net/2016/06/24/gophers-please-tag-your-releases


Library project issue

Hi,
I have 4 project.
common
model
service
view
view only see service, service only see model, all of these see common.
I put butterknife lib to common, set the annotations processing. In the view project i can use annotations, but eclipse say for @InjectView value: "The value for annotation attribute InjectView.value must be a constant expression"
@InjectView(R.id.toastviewcontainer)
ToastContainerView toastContainerView;
The .aptgenerated folder created and contains this:
"public class MainActivity$$ViewInjector {
public static void inject(Finder finder, hbogo.view.activity.MainActivity target, Object source) {
View view;
view = finder.findById(source, 0);
target.toastContainerView = (hbogo.view.toast.ToastContainerView) view;
}
public static void reset(hbogo.view.activity.MainActivity target) {
target.toastContainerView = null;
}
}"
How can I correctly use butterknife in library projects?
Sry my bad english ;)

has this been resolved yet?

No. And it probably never will be.
On Wed, Apr 15, 2015, 10:40 AM jonneymendoza<EMAIL_ADDRESS>wrote:

has this been resolved yet?
—
Reply to this email directly or view it on GitHub
https://github.com/JakeWharton/butterknife/issues/45#issuecomment-93426719
.

It can now be used in a library....view the readme


#7XzHfT9w Investigate options for student identification [2-6h]

Created DeviceIdHelper class for get the devices Id

Rename from "device_id" to "deviceId" to follow Java code style guidelines.


/bootstrap/latest/css/bootstrap.min.cs -> v4.0.0 instead of latest ?

The bootstrap link https://stackpath.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css returns version 4.0.0 instead of the latest 4.4.1 at the time of writing. From the /latest in the path I'd though this would be the current version.
I thought maybe this might be a error and whatever job updates the "latest" link isn't working, hence reporting in case.
[disclaimer] I'm not a webdeveloper or bootstrap user. I didn't know if this was expected behaviour or accidental, so just raising for consideration. I did search the previous reports but there's a lot of results for these search terms so if this is already raised I apologise.
The only reason I was looking at this was I was going to do a scripted job that compared the version on the local site to the version returned by the "latest" URL and then the job would notified the admin if there was a difference so they could take a look. But of course the git notifications system for new releases already exists.

I've just read the similar situation with jQuery detailed here: https://forum.jquery.com/topic/what-happened-to-jquery-latest-min-js-on-code-jquery-com which explains why a "latest" url causes problems for projects. I hadn't realised.
As an alternative feature query would a URL that when called returned simply a string of the current release (for example "4.4.1") be possible?

@mutantsausagedog you are not supposed to use this. It's not exposed anywhere in the frontend and it's not updated.


Separate PRs for inputs

Is there a way to create separate PRs for each input being updated, instead of a PR including the updates of multiple inputs?
It could query locks.nodes.root.inputs in nix flake metadata --json, and then just individually update/create a PR for each one, perhaps?

You could use the inputs targeting that already exists (https://github.com/DeterminateSystems/update-flake-lock#example-updating-specific-inputs) and use multiple jobs each targeting a different input, I'd bet.

Looks like that's what you did in https://github.com/DeterminateSystems/update-flake-lock/issues/70, so I'm going to close this. Feel free to reopen if you have anything else to add!