Node health checks fail to complete all runs most of the time for run counts other than 5 or 1

Checklist

[X]  I am not using Home Assistant. Or: a developer has told me to come here.
[X] I have checked the troubleshooting section and my problem is not described there.
[X] I have read the changelog and my problem is not mentioned there.

Deploy method
Docker
Z-Wave JS UI version
8.7.0
ZwaveJS version
10.3.1
Describe the bug
The network graph's 'node health check' feature fails to complete its runs a good portion of the time when a run count other than 5 or 1 are used.
For run counts of 5 and 1 it works most of the time and completes all runs, but for other values it cancels part way through most of the time and I'm not sure why. For values of 9 or higher it almost never starts. I got it to work once with a run count of 10, out of many attempts.
To Reproduce
Run node health checks with run counts above 10 for the quickest reproduction, but any values other than 5 or 1 I've noticed have a large chance of failing to complete all runs or sometimes any runs at all.
Expected behavior
Expected the health checks to complete for the number of runs entered.
Additional context
Here is a video showcasing the issue: https://www.youtube.com/watch?v=PGocFe9YRCE

Forgot to upload the ZUI log. Here it is:
z-ui_2023-01-24.log

Think I found the reason. Exceptions while calling a node are not caught, and they also aren't displayed on the UI when the 'network graph' page is open.
Setting this up with configs I expected to fail part-way through, i switched back to the main dashboard and that's where the exception was displayed when the health check broke.

Seems I'm having some decode issues. But since exceptions (just this specific one perhaps) aren't caught or displayed on the page I didn't realize it was due to an error until now.
Is it reasonable to expect that the health check would mark the ping as failed and perhaps list the unique reasons they failed at the end instead of silently cancelling the health check?

Apart from the UI issue not showing errors, @AlCalzone any clues?

Please make a driver log, loglevel debug and attach it here as a file.
This should give us a better idea why it is failing.

I ran health checks with varying quantities of runs and varying nodes. Logs attached.
z-ui_2023-01-25.log
zwavejs_2023-01-25.log

Ok I think I've identified a potential issue. Not sure if my planned fix is correct, because the command sequence doesn't really add up.
https://github.com/zwave-js/node-zwave-js/issues/5366

Based on what you described in that issue this may be a linchpin for the stability of my network because I see dropped messages a lot, along with the decode failure message.
Or is the decode failure a separate problem entirely?

Not sure if that's your actual issue, but the sequence here is as follows:

driver to stick: here, send this
at the same time: node to stick to driver: I didn't understand that (actually a possible response to what was just attempted to send)
stick to driver: could not accept your last command, please repeat
driver to stick: here, send this
stick to driver: I sent this
stick to driver: it was received

that second thing is what I find weird. In any case we should probably just ignore it in that situation, because it causes the outgoing command to be re-transmitted immediately, leading to another "I didn't understand that".

Interesting. If you have a way of pushing out a beta version with that change I'd be happy to try it and send logs.


Correct schema on error

When validating a draft 03 json with a missing required property, the schema that is displayed is the previous property, not the the offending one. Here is a minimal sample schema:
{
    "$schema": "http://json-schema.org/draft-03/schema#",
    "type": "object",
    "properties": {
        "moose_value": {
            "required": true,
            "type": "number",
            "minimum": 0,
            "description": "This should not be displayed"
        },
        "sausage_version": {
            "required": true,
            "type": "integer",
            "description": "This should be displayed when we fail."
        }
    }
}

And here is an invalid json, not the misspelled second property:
{"moose_value":5.0e+02,"sausage_venison":4}

This is the current behavior:
[{filename,<<"error_data.json">>},
 {result,error},
 {errors,[[{invalid,data},
           {schema,[{<<"required">>,false},
                    {<<"type">>,<<"number">>},
                    {<<"minimum">>,0},
                    {<<"description">>,<<"This should not be displayed">>}]},
           {error,missing_required_property},
           {data,[{<<"moose_value">>,500.0},{<<"sausage_venison">>,4}]},
           {path,[]}]]}]

Note how the required property is thrown away and the description is from the previous property.
This is the expected output, which is the output from this branch:
[{filename,<<"error_data.json">>},
 {result,error},
 {errors,[[{invalid,data},
           {schema,[{<<"required">>,true},
                    {<<"type">>,<<"integer">>},
                    {<<"description">>,
                     <<"This should be displayed when we fail.">>}]},
           {error,[{<<"type">>,missing_required_property},
                   {<<"value">>,<<"sausage_version">>}]},
           {data,[{<<"moose_value">>,500.0},{<<"sausage_venison">>,4}]},
           {path,[]}]]}]

Tack CJ! I made one small change to keep the previous structure intact - error property is still just the error "type", always, but the reason struct has an optional error_details property. https://github.com/for-GET/jesse/commit/bf0b5bd034a22ffc07ce1dd8b2d1d31d8e28ec52


I have setup the  SEO or the meta tags on each page, but sharing it in LinkedIn doesn't work

I have setup the  SEO or the meta tags on each page, but sharing it in LinkedIn doesn't work

@danielroe you can check my sample blog site here https://brojenuel-blog.ml (post added are for testing only)
when I try to share it on Twitter and Facebook it works fine, it renders fine.
But when I try to share it on LinkedIn the post doesn't render the expected view.
sample render post in twitter:

sample render post in linkedin:

I tried testing the link here in the LinkedIn URL post inspector: https://www.linkedin.com/post-inspector/
This is how I render at in each page:
head() {
        return {
            title: this.article.title,
            meta: createSEOMeta({
                title: this.article.title,
                description: this.article.description,
                image: this.article.img,
                url: process.env.baseUrl +'/view/'+ this.$route.params.slug
            }),
        }
    },

createSEOMeta() this function is here:
export const createSEOMeta = (data: any) => [
    { hid: 'og:title', property: 'og:title', content: data.title },
    { hid: 'description', name: 'description', content: data.description },
    { hid: 'image', property: 'image', content: data.image },
    {
      hid: 'og:description',
      property: 'og:description',
      content: data.description,
    },
    { hid: 'og:image', property: 'og:image', content: data.image },
    {
      hid: 'og:url',
      property: 'og:url',
      content: process.env.HOST_NAME + '/' + data.url,
    },
    {
      hid: 'twitter:card',
      name: 'twitter:card',
      content: data.cardType || 'summary_large_image',
    },
]


Password Error

I have capitalized letters in my password such as "D", "A", "C"...
When I write my password, It doesn't get these chracters.

@serhattsnmz i will fix this ASAP.

@serhattsnmz can you please verfity this fix works for you?

Works for me. Thanks.


Bug: ConfigurationPolicy message for enforce omits objects when multiple namespaces are specified

ConfigurationPolicy message for enforce omits objects when multiple namespaces are specified
When set to inform, the full list of objects is shown. But when set to enforce (the first two messages displayed), only the last object message is shown. In multiple namespaces, the message should be merged.
Should be fixed like this example:
pod [pod1] in namespace test1 found; [pod1] in namespace test2 found as specified, therefore this Object template is compliant
Ref: https://issues.redhat.com/browse/ACM-2604

/unhold

/hold

/unhold


drivers: sensor: Added drivers for Würth Elektronik sensors.

Added drivers and samples for WE sensors (WSEN-HIDS, WSEN-ITDS, WSEN-PADS, WSEN-PDUS, WSEN-TIDS).
Signed-off-by: Yannick Thesen<EMAIL_ADDRESS>

Thanks for the PR!

drivers/sensor/weplatform/WeSensorsSDK.h

It looks like you are integrating parts of an external SDK, which does not comply with Zephyr's coding style and guidelines.
I would recommend you follow the contributing external source code guide and decide if you want to integrate this as a module or as part of the Zephyr tree. Please read the section carefully to decide, then open an issue explaining a bit more about your SDK and how you'd like it integrated.

It looks like you are integrating parts of an external SDK, which does not comply with Zephyr's coding style and guidelines. I would recommend you follow the contributing external source code guide and decide if you want to integrate this as a module or as part of the Zephyr tree. Please read the section carefully to decide, then open an issue explaining a bit more about your SDK and how you'd like it integrated.

Thanks for the information. Our current intention is to adapt the external code (taken from our existing Sensors SDK) to Zephyr's coding style and guidelines and keep it inside the Zephyr tree.
Is it required that we open an issue as you described or can we simply push the updated files?

Ok. We intend to maintain the code in Zephyr's main tree.
Nevertheless, I opened an issue, as you suggested.

We intend to maintain the code in Zephyr's main tree.

In that case, I suggest splitting up the changes and submitting each driver as a separate PR. Start with one driver first and get all the issues sorted out, then fan out to the other drivers.
Thanks for contributing!

Thank you for the feedback!
We have discussed the matter internally and decided to go with integration as a module after all, as this is probably the cleanest solution. I will change the issue accordingly.

Closed, as drivers will be split into separate pull requests (started with #47949).


[UE4.16] Crash in packaged game

As described here (https://www.fmod.org/questions/question/eta-for-fmod-for-ue-4-16/#sabai-entity-content-46100), my game crashes in packaged builds on startup (editor and launch from editor works fine).
I tried several things and it turned out, that I do this in my default game mode's constructor:
(void)IFMODStudioModule::Get();
I do this, because in the past, when I didn't do this, FMOD events from my character blueprint (which gets loaded in the game mode's constructor as well, wouldn't play as they are simply not yet available on blueprint construction then.
This worked well in the past, but now crashes (because when I uncomment the line mentioned above, everything runs without a crash, but AGAIN: The fmod events in my character blueprint won't play.
What is the best/recommended way of handling this?

Note: I have a workaround in place. The thing is, that the constructor of my game mode gets called on package load somehow. What I do now is to override the InitGame method and set the DefaultPawnClass there (including the (void)IFMODStudioModule::Get(); part just above) and calling Super::InitGame(...) afterwards.
This feels very hacky and I'm really not happy with this solution, but it works for now (no crash AND everything playing in packaged builds).
I still would be happy about an investigation on the crash.

I'm having the exact same problem, tried your solution but I don't understand how to set DefaultPawnClass  out of the constructor, I'm using ConstructorHelpers::FClassFinder to get the pawn from a blueprint and it doesn't work out of it.
Have you found a better solution? I've just spent a whole day stuck on this :/

This is documented on our UE4 Deployment page of the docs:
https://fmod.com/resources/documentation-api?page=content/generated/engine_ue4/deployment.html#/
Under heading 'Loading blueprints before plugin load'.


add low frequency variants

Add ability to count variants near the common frequency threshold as well.
Noting that Matt commented on this in an old PR (https://github.com/populationgenomics/saige-tenk10k/pull/68), highlighting how more checkpoints should be used I think, to avoid duplicated computation? Any help there would be useful, but also as I noted in that PR these operations are very cheap.

In general count operations should be reduced/removed, as they're computationally very expensive and none of the processing done is saved. This script is just counting with no saved output, so I don't know what purpose it serves, but this change is fine I guess 😂

The purpose this serves is that I need to know these numbers to write into the paper / know them when people ask when I present these data. Specifically in this case (for the TOB cohort) we also have SNP array data so I wanted to know how many more variants we can call for WGS to make plots / write ups. The SNP data is just plink files on HPC so I can instantly get these numbers, here everything is always harder. If there is another obvious way to do this, e.g. save a summary table with AF info into the analysis bucket, or at least make this code more efficient, I am happy to hear suggestions.

The purpose this serves is that I need to know these numbers to write into the paper

I thought it would be, in which case this is fine. As a general rule, doing count operations just for info is wasteful as it doubles the amount of calculation being performed. Here the counting is the sole purpose, so it's unavoidable.
You're not doing many filters/operations on the data so this shouldn't be too bad, and using this kind of script is preferable to changing other scripts that already work just to include additional counts.
My improvement suggestion would be store the results in a file instead of just logging the lines inside the hail batch job. It would be more robust to export the same data in hard copy so that you don't need to rely on finding the same batch and copy/pasting to keep the results.


Investigate if we can create a plugin-bundler-metro

https://github.com/facebook/metro-bundler

Will revisit later.


[BEAM-9794][release-2.21.0] Reduce state cells needed for BufferingDoFnRunner

Backport of #11478.
The BufferingDoFnRunner create a new state cell for buffering data during each
checkpoint. This led to the number of state cells to reach Short.MAX_VALUE, the
maximum of supported Flink states.
This change keeps a fixed number of state cells depending on the maximum
configured parallelism for checkpoints. The state cells are reused after the
checkpoint has been acknowledged.

CC @ibzib


Enhancement: Option for embedding prompt/workflow in PNG

Added optional parameter that can be used to enable or disabled the embedding of prompt/workflow details in PNG.
It's enabled by default.   One slight issue however is that the prompt details captured in the parameters doesn't contain the correct SEED if you are generating multiple images.   This occurs even if you embed the workflow.   The comment is only generated once and not per image.  Addressing this is beyond the scope of this change.

Summary by CodeRabbit

New Features

Added the ability to embed workflow and prompt JSON when saving files and images.

Looks good! But let's call it "embed_workflow_in_png" to be more clear that it is for PNG only.

Thanks man.  Good idea - makes it clear as to what its for.


Brainstorming NLG Ideas

Description of Problem:
Placeholder for brainstorming future NLG ideas/long term plans for response generation. Will add a doc when I've finished organizing my thoughts.

Brainstorming NLG ideas is here.


Not getting Bandwidth of 40Mhz  in CSI data

I am trying to collect CSI data from 2 ESP32 Wrover B.By default it is showing 40mhz in the settings but when I am trying to collect the CSI data it is showing 0 in bandwidth(CWB)  (0 for 20 Mhz and 1 for 40 Mhz). Could you please help me in finding the mistake.Below is the attachment of CSI data.

CSI_DATA,12,1a:00:00:00:00:00,rssi--41,rate-11,sig_mode-1,mcs-0,cwb-0,smoothing-1,not_sounding-1,aggregation-0,stbc-0,fec_coding-0,sgi-1,noise_floor--93,ampdu_cnt-0,channel-11,secondary_channel-2,timestamp-131164,ant-0,sig_len-44,rx_state-0,128,1,"[44,-64,2,0,0,0,-4,4,-13,19,-13,20,-13,21,-12,22,-12,23,-12,25,-12,26,-12,27,-12,28,-11,28,-11,30,-11,31,-11,32,-10,32,-11,33,-10,35,-9,36,-8,36,-9,36,-9,37,-8,38,-7,40,-7,40,-6,40,-5,42,-6,43,-6,44,-6,45,-3,23,-3,46,-4,46,-4,47,-4,48,-3,49,-2,50,-2,50,-2,50,-2,50,-2,52,-2,53,-3,53,-4,53,-4,53,-3,54,-4,55,-5,55,-6,56,-6,56,-6,54,-8,53,-9,52,-11,52,-13,52,-14,51,-14,50,-15,49,-16,49,-4,12,0,0,0,0]"

From where on the menu screen did you set the bandwidth from 40MHz to 20MHz?


GodotPhysics 3D bugs not present in Bullet (KinematicBody3D)

Godot version
3.4.2
System information
Windows 7 64-bit
Issue description
A few issues with Godot Physics that aren't present if the engine is switched to Bullet.
Steps to reproduce
Here's is an example of ramp handling in this movement + upstepping controller, none of this glitching occurs with bullet:
https://user-images.githubusercontent.com/16231628/150599314-e6c72c45-ecf7-4497-a038-e9938075fa0f.mp4
Some more ramp weirdness:
https://user-images.githubusercontent.com/16231628/150600827-d5b29e23-932f-48d2-b706-0bb1145abe41.mp4
Strange edge detection (wish I hadn't hit stop cause on the last couple of frames I get stuck halfway into the ramp and cannot move):
https://user-images.githubusercontent.com/16231628/150600988-4f437dac-b86c-4fdc-8908-605166bce07c.mp4
There's other times where it'll get stuck in unusual geometry (right at the end I can't move):
https://user-images.githubusercontent.com/16231628/150601113-15075af2-cdf7-4f37-976f-1c36079f20e3.mp4
This is all fixed by using Bullet, here's my test project:
Minimal reproduction project
gp_vs_bullet.zip

Starting to wonder if this is because of my use of cylinder colliders rather than capsule colliders, I haven't tested thoroughly yet but the problems don't seem as bad (or present?) if switching to capsules. @pouleyKetchoupp do cylinders have some issues with edge detection using Godot Physics compared to capsules?

Here's Godot Physics getting stuck with a box collider around tight architecture (if I set the collider to not rotate with the camera, it's impossible to rotate free)
https://user-images.githubusercontent.com/16231628/150786371-afc36501-9ddd-4dfa-a8a4-9a1063bf45a4.mp4
boxcollider_test.zip

Here's Godot Physics getting stuck with a box collider around tight architecture (if I set the collider to not rotate with the camera, it's impossible to rotate free)

What do you mean? When using a box collider for a character, you should never rotate this collider (effectively treating it as an AABB). Instead, you should rotate the camera only. This is how all games that use AABB-based colliders handle things (id Tech, Source, …) :slightly_smiling_face:

Here's Godot Physics getting stuck with a box collider around tight architecture (if I set the collider to not rotate with the camera, it's impossible to rotate free)

What do you mean? When using a box collider for a character, you should never rotate this collider (effectively treating it as an AABB). Instead, you should rotate the camera only. This is how all games that use AABB-based colliders handle things (id Tech, Source, …) slightly_smiling_face

Yep, I'm not rotating the collider for those very reasons, I was just saying that if I do rotate the collider, I can actually loosen the body and move freely whereas with fixed rotation it gets stuck indefinitely, ironically enough.

I'm also experiencing these issues, but they seem even more pronounced with Godot 4.  I end up teleporting all over the place if I try to move up even a gradual slope with a cylinder collider.  Capsule is better, but even the capsule collider gets stuck against geometry (easiest repro is have 2 convex hulls 1m apart and have a 1m diameter capsule or cylinder and you will just get stuck permanently if you try to go between them).  Collision behaves a bit better using box shapes, but I need convex hulls for more complex level geometry.

FWIW, in GD4 I noticed the same issue (even more pronounced) where a basic character body (cylinder, or capsule) couldn't even walk over low terrain, and I work around it by implementing something similar to smooth stepping (https://github.com/mrezai/GodotStairs) with physics collision checks to test if the body can "step up" or not.

cc @fabriceci

There are known problems with cylinders at the moment, like #57476
@jitspoe Could you provide a minimal reproduction project in 4.0 without, if possible, using cylinder shapes? (to avoid mixing issues)
@timshannon The handling of stairs is left to the user (at least for now), if your capsule hits the ground with an angle greater than the floor_max_angle, you will be effectively stopped. If this is not what happened, same thing, could you please provide a minimal reproduction project?

@fabriceci Yeah, here's pretty much the simplest example of getting stuck.  Just use the arrow keys to move between the 2 boxes and note that sometimes you can't move back out.
test_capsule_stuck.zip

@elvisish Have you tried with Godot 4, does the problem also exist (without using a cylinder shape)? If so, can you post an MRP (the code has changed a lot between v3 and v4).
@jitspoe thanks for the MRP, I have checked your issue, it's a different one (maybe you should open an new issue)
This is a very special case in fact, the space between the walls are exactly the same as the size of the player.
The first problem I saw was that the body did not detect the floor, but only the walls, so it was not considered on_floor.
Unfortunately, solve this doesn't fix the issue, because I'm pretty sure that the problem is due to how the engine works. When a body collides with something, the engine depenetrates the object by pushing it a bit more than necessary to make sure it isn't stuck on something (because of the approximation I guess).
So in this case, the body is pushed a bit into the wall, and it gets stuck. So not sure we can do something.
Maybe, a hack to handle this special can be written in move_and_slide, we have to see if it's worth it and if it doesn't cause other problems.

@elvisish Have you tried with Godot 4, does the problem also exist (without using a cylinder shape)? If so, can you post an MRP (the code has changed a lot between v3 and v4).

Not yet, I've not wanted to try until at least in beta but I can try it and see. The project I posted is a really good test case for these issues and can probably always be used as a cross reference for any bug fixes to either bullet or Godot physics.

@elvisish  I recommend to try in a minimal way, using the default script template for movement in Godot 4, with that, you only need to add the level that produce the issue. The more minimal the code, the more it isolates the problem.

@elvisish I recommend to try in a minimal way, using the default script template for movement in Godot 4, with that, you only need to add the level that produce the issue. The more minimal the code, the more it isolates the problem.

I don't use Godot 4 and I'm unlikely to until at least beta as I'm not currently bug hunting GD4, rather I'm interested on GD3 being as solid as possible (could be years until GD4 is stable). The movement I'm using is entirely dependent on move_and_slide() so if there's any bugs it's not likely to be the controller but the KinemeticBody physics as the movement code just inputs a velocity to move_and_slide(). If GD4's default movement works, that would be cool but I'm not sure if it'll make much difference to how GD3 works unless fixes are backported, and unless the GD4 default movement has stair climbing built-in (which I'm pretty it doesn't?) I'd still need to use my movement.
Godot Physics are much more precise for space state work currently, but it's really easy to break move_and_slide() and get totally stuck by just hitting a wall or seam in the wrong way, something that bullet doesn't have any issue with (but is really bad with precision space state work).

I'll have to see about making a simpler reproduction level, as I'm using Qodot here with a complex map, but even with the capsule, I'm running into a lot of cases where I get stuck on things and can't move.  Sometimes I get launched sky high:
https://clips.twitch.tv/FamousClearCrowLeeroyJenkins-girtkzcbvfPqT1Rc
As things currently stand, I think 4.0 is far too broken to release in its current state, since the Godot physics are the only option.  This is nearly unusable.  Not sure if it's just an issue with move_and_slide() or something more core.

@elvisish Yes I understand, move and slide is shared between Godot Physics and Bullet, the cause comes from elsewhere.
I took the time to test your project, I replaced the movement code by a minimal code (to limit factors). After checking, the case you provide, I have these problems only with the cylinder. I think it's the same problem as #57476, as I said previously, currently the contact points returned in case collision with a cylinder has a problem.
Do you experience an issue with capsule in your test project?
capsule:

cylinder

@elvisish here is my minimal project based on yours: minimal cylinder.zip I don't see obvious things. If there are additional issues, don't hesitate to open new ones so as not to mix everything up.

@jitspoe The previous bug and this one are not related to the issue. We should try to avoid mixing issues in one thread, it will become unmanageable. Please open new issues.

I'll have to see about making a simpler reproduction level, as I'm using Qodot here with a complex map, but even with the capsule, I'm running into a lot of cases where I get stuck on things and can't move. Sometimes I get launched sky high:
https://clips.twitch.tv/FamousClearCrowLeeroyJenkins-girtkzcbvfPqT1Rc

I understand the frustration, the thing about physics is that a small bug can have an incredible effect. Please try to reproduce this bug in a minimal project so that we can debug. Major bugs like this will have to be fixed.

Noticed something interesting: The cylinder behavior on slopes seems to be a lot better with triangle mesh collision than convex hulls (in Godot 4).  It still sticks and hangs up a bit, but at least it doesn't teleport all over the place.

@jitspoe did you manage to reproduce the bug that ejects the player? (even using the imported map).

The clip I posted where I got stuck and launched into the air was with a capsule.  Since this bug has been tweaked to specifically deal with cylinders, I will note this:
The problem is not specific to move_and_slide().  I tried implementing my own movement using move_and_collide(), and the cylinder still teleports around and falls through geometry.

@jitspoe yes, the cylinders the problem is already identified and understood, this should be fixed. It is not indeed related to move_and_slide, it is the contact points that are wrongly returned by the algorithm for cylinders.
Now that I know that was a capsule, I'm more curious about the bug in the video, it will be great to be able to reproduce it.

@jitspoe yes, the cylinders the problem is already identified and understood, this should be fixed. It is not indeed related to move_and_slide, it is the contact points that are wrongly returned by the algorithm for cylinders.
Now that I know that was a capsule, I'm more curious about the bug in the video, it will be great to be able to reproduce it.

I've managed to create a simple reproduction case using a small section of my level and created a new issue here: https://github.com/godotengine/godot/issues/65596


unitCost vs. arbitraryUnitCost

Hello,
I have a working integrated standalone cart for Ultracart using the REST API.
for the CartItem, I was wondering what the difference is between unitCost and arbitraryUnitCost.
I am asking, because in our cart, we do have some special financing deals where we want to have a different cost for a product directly. I was wondering if I can use either of those above to set the charged price for the product independent of the set cost that we have in Ultracart.
is that possible? thanks!

Hello,
I found the information I needed for this here: https://secure.ultracart.com/merchant/integrationcenter/checkoutapi_v3/demo1.html#demo25 .
Just a reference for any other person needing it.


Uninstall example using powershell

This page says there are 2 ways to uninstall the VDI MSI for Teams, PowerShell, and MSIEXEC command line.  You give an example for the MSIEXEC but not for PowerShell.  Please provide a PowerShell Script like you did MSIEXEC.

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

ID: 17880b9d-6b98-3194-cc33-fe8067ce241e
Version Independent ID: 643bcf2f-507b-e449-73db-923d8a368ad9
Content: Teams for Virtualized Desktop Infrastructure - Microsoft Teams
Content Source: Teams/teams-for-vdi.md
Service: msteams
GitHub Login: @LanaChin
Microsoft Alias: v-lanac

@brucesp1  Thank you for submitting feedback and contributing to the docs. We are currently investigating this.

Hi @brucesp1, thank you for your feedback.
The script is not available anymore, please use the MSIEXEC method. I am updating the article, thank you for pointing it out.

@brucesp1 Thank you for submitting feedback. We understand that this issue has been resolved.
Please feel free to re-open this issue if there is a specific area of the docs that we can improve or make better. Thank you.


Initialize Singleton class in FastAPI startup event not working

First Check

[X] I added a very descriptive title to this issue.
[X] I used the GitHub search to find a similar issue and didn't find it.
[X] I searched the FastAPI documentation, with the integrated search.
[X] I already searched in Google "How to X in FastAPI" and didn't find any information.
[X] I already read and followed all the tutorial in the docs and didn't find an answer.
[X] I already checked if it is not related to FastAPI but to Pydantic.
[X] I already checked if it is not related to FastAPI but to Swagger UI.
[X] I already checked if it is not related to FastAPI but to ReDoc.

Commit to Help

[X] I commit to help with one of those options 👆

Example Code
from fastapi import FastAPI
from config.ConfigLoader import ConfigLoader # Here ConfigLoader is singleton class

app = FastAPI()

APP_VERSION = "v1"

app.include_router(SegmentRoute.router)

@app.on_event("startup")
async def startup_event():
    ConfigLoader(APP_VERSION).get_instance()

# some other file
ConfigLoader().get_instance() # this code is been called first before fastAPI's startup event

Description
Start the app with uvicorn main:app --reload
I want to create a single object of my singleton class from FastAPI's startup event. But the similar code i wrote in some other py file which should return created object (object which should be created from startup event).
But the problem is, code to get instance from other file is been called before startup event function of FastAPI. So my code is failing saying that class is singleton. (I have added exception if someone try to create 2nd object)
Any fix for such situation?
Operating System
Linux
Operating System Details
No response
FastAPI Version
0.85.0
Python Version
3.10
Additional Context
No response

If your class is a singleton, then why does it matter where it is created? It would return the same object once it already exists, right? Or at least, that is the singleton pattern. It seems it is created with different arguments in your code, what is the envisioned behaviour of that design choice?

You can probably use an lru_cache as explained here: https://fastapi.tiangolo.com/advanced/settings/#creating-the-settings-only-once-with-lru_cache

Thank you sir!

Thanks for coming back to close the issue! ☕


It doesn't have tests, chain child verifies to their ancestors, or
support checkpoint maximum height queries.
Part of #429.

This PR is ready for review as a stub.
I'll add tests, chain child verifies to their ancestors, and checkpoint maximum height queries in a future PR.

One thing I would note, though, is that in the current setup, the CheckpointVerifier tries to move as much work as possible into the response future, so that all of the response futures are as independent from each other as possible. But this is the opposite of the communication/dependency structure we want, where the service queues up a bunch of blocks while it's trying to assemble a chain from one checkpoint to the next, does the work of checking the chain once, and then sends notifications to all of the callers of the queued blocks. So going from here to the functionality we want (checkpoints every 1000 blocks) will require basically a complete restructuring of the CheckpointVerifier internals to change this structure.

I understand, I just wanted something that I could write simple tests against.

I think we'll want a separate service that makes all of the changes to the main chain state. See #516 for details.
(Pruning side-chains can be a separate service, because side-chains don't have any derived state.)


Added codecov.yml

Codecov Report

Merging #3 (730c69f) into main (e1f4660) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main       #3   +/-   ##
=======================================
  Coverage   92.30%   92.30%
=======================================
  Files           6        6
  Lines         429      429
=======================================
  Hits          396      396
  Misses         24       24
  Partials        9        9

Continue to review full report at Codecov.

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


layout.might_permit_raw_init supports additional checks

Rust's layout.might_permit_raw_init went from taking true/false flag to taking:

InitKind::Zero, * which corresponds to the old true (and the intrinsic assert_zero_valid)
InitKind::Uninit, false which corresponds to the old false (and the instrinsic assert_uninit_valid)
InitKind::Uninit, false which adds an additional strict check. Unclear if we want it for something.

Upstream PR: https://github.com/rust-lang/rust/pull/97323

In the most recent update, Rust provides two methods permits_zero_init and permits_uninit_init for the type context (where layout is the argument) instead of the method might_permit_raw_init for layouts.
The updates to the intrinsics code in #1399 make use of them (as in the ssa and cranelift backends), so there's nothing else to do here.


Showcase projects using Kompendium

I'm using Kompendium for my project and it's great! Straightforward implementation. Just wanted to ask if there would be any interest of showcasing projects using it on your docs or similar?
Personally I would find it benefitial to see how others have used it, even though you have examples it would be interesting to find see others. This is how I've used it in Ktor: https://github.com/kryptokrona/kryptokrona-api
Let me know what you think!
Cheers

I like that idea! I think a Github discussion is the best place for that at the moment.
I opened one here, hope people fill it out!
https://github.com/bkbnio/kompendium/discussions/444


[CARBONDATA-1259] CompareTest improvement

changes:

check query result details, report error if result is not the same
add support for comparison with ORC file
add decimal data type

Build Success with Spark 1.6, Please check CI http://<IP_ADDRESS>:8080/job/ApacheCarbonPRBuilder/294/

Build Failed  with Spark 2.1.0, Please check CI http://<IP_ADDRESS>:8080/job/ApacheCarbonPRBuilder/2878/

retest this please

Build Success with Spark 1.6, Please check CI http://<IP_ADDRESS>:8080/job/ApacheCarbonPRBuilder/314/

Build Failed  with Spark 2.1.0, Please check CI http://<IP_ADDRESS>:8080/job/ApacheCarbonPRBuilder/2900/

Build Success with Spark 2.1.0, Please check CI http://<IP_ADDRESS>:8080/job/ApacheCarbonPRBuilder/2902/

Build Success with Spark 1.6, Please check CI http://<IP_ADDRESS>:8080/job/ApacheCarbonPRBuilder/316/

Build Success with Spark 1.6, Please check CI http://<IP_ADDRESS>:8080/job/ApacheCarbonPRBuilder/317/

Build Success with Spark 2.1.0, Please check CI http://<IP_ADDRESS>:8080/job/ApacheCarbonPRBuilder/2903/

LGTM


Question about the content of module and module.children

I have the following script:
var module1= require('./module1);
var instance1= new module1.myclass1();
...
var module2= require('./module2);
var instance2= new module2.myclass2();

I pass the script to the engine (eval) and then I map each instance to a java class with the method getInterface(object, class).
The two modules and the two instances are created in the engineScope.
In the Module.class there is this part:
  private Module compileJavaScriptModule(Folder parent, String fullPath, String code)
      throws ScriptException {
    Bindings engineScope = engine.getBindings(ScriptContext.ENGINE_SCOPE);
    Bindings module = createSafeBindings();
    module.putAll(engineScope);

and then this other part:
  public Object require(String module) throws ScriptException {
    ...
    try {
      // If not cached, we try to resolve the module from the current folder, ignoring node_modules
      if (isPrefixedModuleName(module)) {
        found = attemptToLoadFromThisFolder(resolvedFolder, filename);  // this calls the method compileJavaScriptModule
      }
	...
    children.add(found.module);

So at the end I have module1 and instance1 among the children of  module2. Obviously I have also all other things present in the engineScope (e.g. require, exports, and module <main>). The more I load module the more the structure becomes redundant.
Considering that I am new to Nashorn and node.js and there is no many information  about module.children I'm questioning if it is correct to put the full content of the engineScope as child of a module.
Thanks for your attention.
aris
P.S. I've tried to comment module.putAll(engineScope): it works even so and the content of children seems more correct to me because I see only the module objects required by the one I'm inspecting.

I've done a little test to explain well what I mean. I've created 4 modules (written in typescript and transpiled with module set to commonjs). The relation between modules is as follow:

module1 use subsubmodule
module2 use submodule which use subsubmodule

The test:

loads in this order module2 and module1
creates an instance of the class contained in each module
invokes a method on each instance
finally stringify the engineScope as Json

The test has been run both with the original code of nashorn-commonjs-modules and with the module.putAll(engineScope) commented.
The attached zip contains the java main to run the test, the four js modules, the two json produced from the runs.
modules-test.zip

I've found the moment when the change has been made:
Use real JS object whenever we need an instance of Bindings.
but I don't understand why the module.putAll(engineScope) has been added.
Thanks for your attention.

Sorry, I haven't been much responsive, as mentioned in another issue I'm deep into house renovation work 😁
From what I remember, I added this part to copy the content of the global scope, because NashornScriptEngine.createBindings does some special magic when not running with the --global-per-engine flag (the default). Aka it allocates a brand new Global. But I've just tested with the line commented out in both modes, and all the UTs are passing, so I'm a bit confused. Certainly I haven't done this for no reasons...
I'll put those changes in a PR and do some more testing.

Don't worry @malaporte and thanks for your response. I'd like to contribute.
I've read this (Nashornjsr223 enginenotes --global-per-engineoption) and some other posts on the mailing list of Nashorn.
I've examined the diff between the current and the previous version of Module.
In the previous version, the call engine.createBindings was used to retrieve main objects (JSON, Object, Error) but in the current version they have been substituted by Module.createSafeBindings which internally calls objectConstructor.newObject().
The reference to objectConstructor and the others to main objects (engine included) are propagated from parent module to its children so the objects used are always the same.
Furthermore engine.createBindings is no more invoked, avoiding any special treatments depending on engine settings. This should explain why the UTs are passing.
For my current understanding it's similar to have the global-per-engine always set (in this way also the name of the method createSafeBindings make more sense to me).


feat(Add experimental ws support):

@CodiumAI-Agent /review

PR Analysis

🎯 Main theme: Adding experimental websocket support to the application.
📝 PR summary: This PR introduces experimental websocket support to the application. It includes changes in multiple files to integrate the websocket service and create new conversation chains. It also includes the addition of new example files to demonstrate the usage of the new features.
📌 Type of PR: Enhancement
🧪 Relevant tests added: No
⏱ Estimated effort to review [1-5]: 4, due to the addition of new features and changes in multiple files, it requires a thorough review to ensure the correct implementation and integration of the websocket service.
🔒 Security concerns: No

PR Feedback

💡 General suggestions: The PR seems to be well-structured with the addition of new features. However, it would be beneficial to include tests to ensure the correct functionality of the new features. Also, it would be helpful to include error handling and logging for the websocket service to track and handle any potential issues.

 🤖 Code feedback:

relevant file: langcorn/server/ws.py
suggestion: Consider adding error handling for potential issues that might occur when creating the websocket service. This could be done by wrapping the code in a try/except block and logging the error for debugging purposes. [important]
relevant line: '+def create_ws_service(*lc_apps, auth_token: str = "", app: FastAPI = None):'

relevant file: examples/app.py
suggestion: It would be beneficial to add error handling when creating the FastAPI service. This could help in identifying and resolving any issues that might occur during the creation of the service. [medium]
relevant line: '+app: FastAPI = create_service('

relevant file: langcorn/server/ws.py
suggestion: Consider adding logging within the websocket endpoint function to track the flow of data and any potential issues. [medium]
relevant line: '+async def websocket_endpoint(websocket: WebSocket) -> LangResponse:'

relevant file: examples/ex5.py
suggestion: It would be beneficial to add error handling when running the conversation. This could help in identifying and resolving any issues that might occur during the conversation. [medium]
relevant line: '+print(conversation.run(input="Hi there!"))'

How to use

Tag me in a comment '@CodiumAI-Agent' and add one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback.
/ask <QUESTION>: Pose a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.

To edit any configuration parameter from configuration.toml, add --config_path=new_value
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, use the /config command.


Use module: node12 in tsconfig.json; supports not transpiling import() / dynamic import for CommonJS code

A most recent merged PR for Typescript now better supports Node 12. In particular there is no need for the "semi-hack" used in module-loader.ts.
You can see discussion here and the PR here. When the latest Typescript version is available w/ this PR I'll look into adding module: node12 to tsconfig.json and verify that import dynamic works correctly with the Oclif core build and remove the workaround.
A blog post about the Typescript 4.5 beta.

@typhonrt Is this work that you're still interested in doing? Or can we close this?


Problem importing materials from USD 21.11 [USDU-342]

In USD 21.11, the type of the UsdPrimvarReader.varname input was changed from token to string, with this commit. Because of this, importing into Unity assets created with USD 21.11 creates objects that are simply colored instead of fully textured.
This can be easily reproduced by exporting a cube with a textured Standard Surface material from Maya 2023 (that ships with USD 21.11).
Is this a known issue ?

Hi Nicolas,
We've logged this internally and have reproduced on our side. Thank you for reporting this.

Hey! This should be fixed in https://github.com/Unity-Technologies/usd-unity-sdk/pull/364. Let us know if you're still having any issues.

@vickycl the fix appears to only address the problem when UsdPrimvarReader.varname is connected, i.e., when the following USD construct is used:
def Material "standardSurface2SG"
{
     string inputs:file1:varname = "st"
     ...

     def Shader "place2dTexture1"
     {
         uniform token info:id = "UsdPrimvarReader_float2"
         string inputs:varname.connect = <../standardSurface2SG.inputs:file1:varname>
         ...
     }
}

Unfortunately, it still fails to work as expected when UsdPrimvarReader.varname is not connected, i.e., when the following USD construct is used instead:
def Material "standardSurface2SG"
{
     def Shader "place2dTexture1"
     {
         uniform token info:id = "UsdPrimvarReader_float2"
         string inputs:varname = "st"
         ...
     }
}

While the former is how Maya exports materials, the latter is how our assets are actually structured. This USD Sample documents both (see PrimvarOcclusion for an example of the latter structure).
I believe there is still a problem with this code: https://github.com/Unity-Technologies/usd-unity-sdk/blob/3ec67b2cf8dd598e48b10e701a3a2d610ff3ec44/package/com.unity.formats.usd/Dependencies/USD.NET.Unity/Shading/UsdPreviewSurface/PrimvarReaderSample.cs#L68-L72
As a quick test, I replaced pxr.Token with string and our materials imported into Unity were then textured as expected. However, this change would not be backward-compatible with other assets in the wild. Do you want me to open a new issue on GitHub for the "not connected" case? Thanks.

Hey @nicolaspopravka thanks for testing it. I'll reopen this one and take another look :)

Can I just check, are you by any chance giving the varname a different value to "st"? "st" is the default PrimvarReaderSample varname, and it seems to work in that case, so I'm trying to figure out whether that's the key difference :)

Indeed, that's the case, we typically have string inputs:varname = "uv" in our materials.

Hey @nicolaspopravka! you mentioned that your assets are generated differently compared to Maya, could we know which tool / program you are using to generate your USD files to generate our own suite of test files?
Thank you!

As a quick test, I replaced pxr.Token with string and our materials imported into Unity were then textured as expected. However, this change would not be backward-compatible with other assets in the wild.

I think this actually might be backwards compatible, because TfToken can be automatically cast to a string. I've added a PR using your approach with a fix up for Export in that case. I've tested it on an asset that I think should be representative of your setup (non-connected primvar, non-default varname), would you mind trying it out on your assets? : https://github.com/Unity-Technologies/usd-unity-sdk/pull/375

Thanks @vickycl. I just rebuilt from your branch and our assets now look as we expect them to: geometry is properly textured.
@lee-aandrew These particular USD files are not exported from third party applications but instead created programmatically in our pipeline.

Hey @nicolaspopravka the fix for this has landed in dev, and will be released soon in 3.0.0-exp.3. Please do reopen the case if you have any more issues :)


Broken image reference for events with no detail image

Looks like the template is trying to display a detail image even if none is set.

@xinyil any design suggestions for events with no details?  It seems to be frequently the case that we have events on the site with a title and date/speaker/event type but no image or text description, which makes the page look lopsided.  Here's an example:

Now fixed


WVD template

Contains WVD ADO generator details

Request to update the folder without space and resubmit the PR.


Added developer

Sometimes you are lucky enough to meet some of the best developers I've ever known in Spain...
If they ( that convert Big Data into a child's play) taught you in the most demonic dark arts such as functional programming, scala, akka, elasticsearch, spark, etc...
The only thing you can say is ¡¡Thank you!!
You are great!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Long live Crossdata!!!!!!!!!!!!

I'll honor you kind message with my favorite :+1: tag: λabc.[b((ab)c)]


test: api integration tests for be

What ❔
API tests for:

Accounts API
Transactions API
Block API

Why ❔
Cover BE API functionality
Checklist

[ + ] PR title corresponds to the body of PR (we generate changelog entries from PRs).
[ n/a ] Tests for the changes have been added / updated.
[ n/a ] Documentation comments have been added / updated.

@pcheremu I reviewed test cases that were added in the scope of this PR.
The comparison was performed using current code and Swagger documentation.
As a result I can confirm that test cases up-to-date. No new response parts, erased or changed were detected.


new GPO operator .map

in PS there are many operator collections: like -contains, -join, where, foreach.... every operator performs one specific task very well (except where and foreach GPO "General Purpose Operator"). it's great but
since ps does not yet implement linq it lacks other important operators like: .map()
$collection.map( {code} , arg1, arg2, $collection2 )
.map()  traverses two lists in parallel, applying a scriptblock to the corresponding items from each list. If one list is longer, the extra elements are ignored.
arg1 = name of first variable in first collection
arg2 = name of second variable in second collection

proof of concept:

PS> (3,5,6).map( {  $a + $b } , a, b, (1,2,4) )
4
7
10

I like the idea in principle, but to me a more PowerShell-idiomatic implementation would be the foreach statement extension I've proposed in #14732 (not limited to 2 collections):
# WISHFUL THINKING
PS> foreach ($a, $b in (3, 5, 6), (1, 2, 4)) { $a + $b }
4
7
10

@mklement0
thanks, +1 for your idea i like and i like more if it implement variable indexer.
But other programmers who are used other scripting/programming languages like python/scala/haskell...etc  use  traditonally statement like map() zip() zipwith() zipwithindex() ...etc. its awesome if PS implement statement/operators like this.

Thanks, @p0W3RH311, and, yes, supporting an automatically maintained index variable, as you've proposed in #14724, is also a good idea (though in my mind it calls for an explicit opt-in with a self-chosen index variable).
As for map() zip() zipwith() zipwithindex(): To me (I know not everyone agrees), PowerShell-idiomatic solutions should be limited to cmdlets, operators, and language statements (such as foreach): methods are an awkward fit, primarily due to the potential for syntax confusion (argument vs. expression mode).
However, given that LINQ methods are already accessible - as something that PowerShell provides access to rather than being a native part of its language, the more promising approach would be to allow LINQ methods to be called more naturally, which would require PowerShell to support extension methods.
Currently, using Linq.Zip() is awkward:
PS> [System.Linq.Enumerable]::Zip([int[]] (3, 5, 6), [int[]] (1, 2, 4), [Func[int, int, int]] { $args[0] + $args[1] })
4
7
10

I think improving this experience is the more promising approach to pursue - see #2226.

As for zipwithindex(), specifically: my thinking behind  #14732 was to allow it to be combined with #14724.
# WISHFUL THINKING
PS> foreach ($a, $b in (3, 5, 6), (1, 2, 4); $ndx) { "$ndx`:" + ($a + $b) }
0: 4
1: 7
2: 10

with native supporting Linq  language PS will become PS++ :) ... all scripting/programming languages have an orientation to functional paradigm and i believe its the time to PS to to follow this path...the best solution is Linq

Looking to some recent proposals and requests for parallel lists and a iterator index, there is clearly a need to join objects side-by-side. Therefore, I did a propose to add a Join-Object cmdlet to the standard PowerShell equipment #14994.
In this idea (and existing example), the Join-Object cmdlet has a brought scalar of join features from joining powershell objects based a related property to side-by-side joining (traversing) scalars (as primitives and strings):
Example 1
# traverse two lists
3, 5, 6 |Join 1, 2, 4 |% { "$_" }
3 1
5 2
6 4

Example 2
# Sum each item in two parallel lists
3, 5, 6 |Join 1, 2, 4 |% { $_[0] + $_[1] }
4
7
10

Example 3
# Sum each item in multiple parallel lists
3, 5, 6 |Join 1, 2, 4 |Join 7, 8, 9 |% { ($_ |Measure-Object -sum).sum }
11
15
19

Example 4
# Index and sum each item in the additional parallel lists
0..9 |Join 3, 5, 6 |Join 1, 2, 4 |% { "$($_[0]): " + ($_[1] + $_[2]) }
0: 4
1: 7
2: 10

Example 5
# Same as above , but with named properties
0..9 |Join 3, 5, 6 |Join 1, 2, 4 -Name Index, a, b |% { "$($_.Index): " + ($_.a + $_.b) }
0: 4
1: 7
2: 10

Language working group:
This issue is a duplicate of #2226.


crt and key file does not exist or not created in certs folder

Bug description
My nginx-proxy implementation are having issues with certificate creation. In my observations I do not see the crt and key files inside certs folder. Can anyone give a hint of what I did wrong?
acme-companion image version
v2.2.8-10-g347e3ef
nginx-proxy's Docker configuration
version: '3.3'

volumes:
  conf:
    driver: local
    driver_opts:
      type: "btrfs"
      device: /home/sysop/projects/nginx-proxy/conf.d
      o: bind
  vhost:
    driver: local
    driver_opts:
      type: "btrfs"
      device: /home/sysop/projects/nginx-proxy/vhost.d
      o: bind
  html:
    driver: local
    driver_opts:
      type: "btrfs"
      device: /home/sysop/projects/nginx-proxy/html
      o: bind
  # dhparam:
    # driver: local
    # driver_opts:
      # type: "btrfs"
      # device: /home/sysop/projects/nginx-proxy/dhparam
      # o: bind
  acme:
    driver: local
    driver_opts:
      type: "btrfs"
      device: /home/sysop/projects/nginx-proxy/acme
      o: bind
  certs:
    driver: local
    driver_opts:
      type: "btrfs"
      device: /home/sysop/projects/nginx-proxy/certs
      o: bind

services:
  nginx:
    image: "nginx:alpine"
    logging:
      options:
        max-size: "10m"
        max-file: "3"
    labels:
      com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
    container_name: "nginx-proxy"
    restart: "unless-stopped"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      # - dhparam:/etc/nginx/dhparam
      - certs:/etc/nginx/certs:ro
      # - /var/run/docker.sock:/tmp/docker.sock:ro

  docker-gen:
    image: "nginxproxy/docker-gen"
    logging:
      options:
        max-size: "10m"
        max-file: "3"
    container_name: "docker-gen"
    restart: "unless-stopped"
    command: -notify-sighup nginx-proxy -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
    volumes:
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      # - dhparam:/etc/nginx/dhparam
      # - acme:/etc/acme.sh
      - certs:/etc/nginx/certs
      - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
    labels:
      - "com.github.jrcs.letsencrypt_nginx_proxy_companion.docker_gen"

  acme:
    image: "nginxproxy/acme-companion"
    logging:
      options:
        max-size: "10m"
        max-file: "3"
    container_name: "acme-companion"
    restart: "unless-stopped"
    depends_on:
      - "nginx"
    volumes:
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - html:/usr/share/nginx/html
      # - dhparam:/etc/nginx/dhparam
      - acme:/etc/acme.sh
      - certs:/etc/nginx/certs:rw
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      NGINX_DOCKER_GEN_CONTAINER: "docker-gen"
      NGINX_PROXY_CONTAINER: "nginx-proxy"
      DEFAULT_EMAIL<EMAIL_ADDRESS>
networks:
  default:
    name: nginx-proxy
    external: true

#networks:
#  default:
#    name: nginx-proxy
#    driver: bridge
#    ipam:
#      config:
#        - subnet: <IP_ADDRESS>/24

rendered nginx configuration

2023/07/24 20:43:34 [warn] 43#43: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/default.conf:88
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/default.conf:88
2023/07/24 20:43:34 [warn] 43#43: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/default.conf:111
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/default.conf:111
2023/07/24 20:43:34 [warn] 43#43: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/default.conf:140
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/default.conf:140
2023/07/24 20:43:34 [warn] 43#43: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/default.conf:169
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/default.conf:169
2023/07/24 20:43:34 [warn] 43#43: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/default.conf:198
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/default.conf:198
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
# configuration file /etc/nginx/nginx.conf:

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

# configuration file /etc/nginx/mime.types:

types {
    text/html                                        html htm shtml;
    text/css                                         css;
    text/xml                                         xml;
    image/gif                                        gif;
    image/jpeg                                       jpeg jpg;
    application/javascript                           js;
    application/atom+xml                             atom;
    application/rss+xml                              rss;

    text/mathml                                      mml;
    text/plain                                       txt;
    text/vnd.sun.j2me.app-descriptor                 jad;
    text/vnd.wap.wml                                 wml;
    text/x-component                                 htc;

    image/avif                                       avif;
    image/png                                        png;
    image/svg+xml                                    svg svgz;
    image/tiff                                       tif tiff;
    image/vnd.wap.wbmp                               wbmp;
    image/webp                                       webp;
    image/x-icon                                     ico;
    image/x-jng                                      jng;
    image/x-ms-bmp                                   bmp;

    font/woff                                        woff;
    font/woff2                                       woff2;

    application/java-archive                         jar war ear;
    application/json                                 json;
    application/mac-binhex40                         hqx;
    application/msword                               doc;
    application/pdf                                  pdf;
    application/postscript                           ps eps ai;
    application/rtf                                  rtf;
    application/vnd.apple.mpegurl                    m3u8;
    application/vnd.google-earth.kml+xml             kml;
    application/vnd.google-earth.kmz                 kmz;
    application/vnd.ms-excel                         xls;
    application/vnd.ms-fontobject                    eot;
    application/vnd.ms-powerpoint                    ppt;
    application/vnd.oasis.opendocument.graphics      odg;
    application/vnd.oasis.opendocument.presentation  odp;
    application/vnd.oasis.opendocument.spreadsheet   ods;
    application/vnd.oasis.opendocument.text          odt;
    application/vnd.openxmlformats-officedocument.presentationml.presentation
                                                     pptx;
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
                                                     xlsx;
    application/vnd.openxmlformats-officedocument.wordprocessingml.document
                                                     docx;
    application/vnd.wap.wmlc                         wmlc;
    application/wasm                                 wasm;
    application/x-7z-compressed                      7z;
    application/x-cocoa                              cco;
    application/x-java-archive-diff                  jardiff;
    application/x-java-jnlp-file                     jnlp;
    application/x-makeself                           run;
    application/x-perl                               pl pm;
    application/x-pilot                              prc pdb;
    application/x-rar-compressed                     rar;
    application/x-redhat-package-manager             rpm;
    application/x-sea                                sea;
    application/x-shockwave-flash                    swf;
    application/x-stuffit                            sit;
    application/x-tcl                                tcl tk;
    application/x-x509-ca-cert                       der pem crt;
    application/x-xpinstall                          xpi;
    application/xhtml+xml                            xhtml;
    application/xspf+xml                             xspf;
    application/zip                                  zip;

    application/octet-stream                         bin exe dll;
    application/octet-stream                         deb;
    application/octet-stream                         dmg;
    application/octet-stream                         iso img;
    application/octet-stream                         msi msp msm;

    audio/midi                                       mid midi kar;
    audio/mpeg                                       mp3;
    audio/ogg                                        ogg;
    audio/x-m4a                                      m4a;
    audio/x-realaudio                                ra;

    video/3gpp                                       3gpp 3gp;
    video/mp2t                                       ts;
    video/mp4                                        mp4;
    video/mpeg                                       mpeg mpg;
    video/quicktime                                  mov;
    video/webm                                       webm;
    video/x-flv                                      flv;
    video/x-m4v                                      m4v;
    video/x-mng                                      mng;
    video/x-ms-asf                                   asx asf;
    video/x-ms-wmv                                   wmv;
    video/x-msvideo                                  avi;
}

# configuration file /etc/nginx/conf.d/default.conf:
# nginx-proxy
# Networks available to the container running docker-gen (which are assumed to
# match the networks available to the container running nginx):
#     nginx-proxy
# If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the
# scheme used to connect to this server
map $http_x_forwarded_proto $proxy_x_forwarded_proto {
    default $http_x_forwarded_proto;
    '' $scheme;
}
map $http_x_forwarded_host $proxy_x_forwarded_host {
    default $http_x_forwarded_host;
    '' $http_host;
}
# If we receive X-Forwarded-Port, pass it through; otherwise, pass along the
# server port the client connected to
map $http_x_forwarded_port $proxy_x_forwarded_port {
    default $http_x_forwarded_port;
    '' $server_port;
}
# If the request from the downstream client has an "Upgrade:" header (set to any
# non-empty value), pass "Connection: upgrade" to the upstream (backend) server.
# Otherwise, the value for the "Connection" header depends on whether the user
# has enabled keepalive to the upstream server.
map $http_upgrade $proxy_connection {
    default upgrade;
    '' $proxy_connection_noupgrade;
}
map $upstream_keepalive $proxy_connection_noupgrade {
    # Preserve nginx's default behavior (send "Connection: close").
    default close;
    # Use an empty string to cancel nginx's default behavior.
    true '';
}
# Abuse the map directive (see <https://stackoverflow.com/q/14433309>) to ensure
# that $upstream_keepalive is always defined.  This is necessary because:
#   - The $proxy_connection variable is indirectly derived from
#     $upstream_keepalive, so $upstream_keepalive must be defined whenever
#     $proxy_connection is resolved.
#   - The $proxy_connection variable is used in a proxy_set_header directive in
#     the http block, so it is always fully resolved for every request -- even
#     those where proxy_pass is not used (e.g., unknown virtual host).
map "" $upstream_keepalive {
    # The value here should not matter because it should always be overridden in
    # a location block (see the "location" template) for all requests where the
    # value actually matters.
    default false;
}
# Apply fix for very long server names
server_names_hash_bucket_size 128;
# Default dhparam
# Set appropriate X-Forwarded-Ssl header based on $proxy_x_forwarded_proto
map $proxy_x_forwarded_proto $proxy_x_forwarded_ssl {
    default off;
    https on;
}
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
log_format vhost '$host $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$upstream_addr"';
access_log off;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305';
    ssl_prefer_server_ciphers off;
error_log /dev/stderr;
# HTTP 1.1 support
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $proxy_x_forwarded_host;
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;
proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl;
proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port;
proxy_set_header X-Original-URI $request_uri;
# Mitigate httpoxy attack (see README for details)
proxy_set_header Proxy "";
# START DEBUG HERE
# akasha.fullertonhealth.co.idakasha.fullertonhealth.co.idfalseredirect
# asa-i.fullertonhealth.co.idasa-i.fullertonhealth.co.idfalseredirect
# darsana-i.fullertonhealth.co.iddarsana-i.fullertonhealth.co.idfalseredirect
# darsana-ii.fullertonhealth.co.iddarsana-ii.fullertonhealth.co.idfalseredirect
server {
    server_name _; # This is just an invalid value which will never trigger on a real hostname.
    server_tokens off;
    listen 80;
    listen 443 ssl http2;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    access_log /var/log/nginx/access.log vhost;
    ssl_certificate /etc/nginx/certs/default.crt;
    ssl_certificate_key /etc/nginx/certs/default.key;
    return 503;
}
# akasha.fullertonhealth.co.id/
upstream akasha.fullertonhealth.co.id {
    # Container: portainer_web_1
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: <IP_ADDRESS>
    #     exposed ports: 25/tcp 8000/tcp 9000/tcp 9443/tcp
    #     default port: 80
    #     using port: 9000
    server <IP_ADDRESS>:9000;
}
server {
    server_name akasha.fullertonhealth.co.id;
    access_log /var/log/nginx/access.log vhost;
    listen 80 ;
    listen 443 ssl http2 ;
    # No certificate found for this vhost, so use the default certificate and
    # return an error code if the user connects via https.
    ssl_certificate /etc/nginx/certs/default.crt;
    ssl_certificate_key /etc/nginx/certs/default.key;
    if ($https) {
        return 500;
    }
    include /etc/nginx/vhost.d/default;
    location / {
        proxy_pass http://akasha.fullertonhealth.co.id;
        set $upstream_keepalive false;
    }
}
# asa-i.fullertonhealth.co.id/
upstream asa-i.fullertonhealth.co.id {
    # Container: asa_i_web_1
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: <IP_ADDRESS>
    #     exposed ports: 8069/tcp 8071/tcp 8072/tcp
    #     default port: 80
    #     using port: 8069
    server <IP_ADDRESS>:8069;
}
server {
    server_name asa-i.fullertonhealth.co.id;
    access_log /var/log/nginx/access.log vhost;
    listen 80 ;
    listen 443 ssl http2 ;
    # No certificate found for this vhost, so use the default certificate and
    # return an error code if the user connects via https.
    ssl_certificate /etc/nginx/certs/default.crt;
    ssl_certificate_key /etc/nginx/certs/default.key;
    if ($https) {
        return 500;
    }
    include /etc/nginx/vhost.d/default;
    location / {
        proxy_pass http://asa-i.fullertonhealth.co.id;
        set $upstream_keepalive false;
    }
}
# darsana-i.fullertonhealth.co.id/
upstream darsana-i.fullertonhealth.co.id {
    # Container: darsana_i_web_1
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: <IP_ADDRESS>
    #     exposed ports: 8069/tcp 8072/tcp
    #     default port: 80
    #     using port: 8069
    server <IP_ADDRESS>:8069;
}
server {
    server_name darsana-i.fullertonhealth.co.id;
    access_log /var/log/nginx/access.log vhost;
    listen 80 ;
    listen 443 ssl http2 ;
    # No certificate found for this vhost, so use the default certificate and
    # return an error code if the user connects via https.
    ssl_certificate /etc/nginx/certs/default.crt;
    ssl_certificate_key /etc/nginx/certs/default.key;
    if ($https) {
        return 500;
    }
    include /etc/nginx/vhost.d/default;
    location / {
        proxy_pass http://darsana-i.fullertonhealth.co.id;
        set $upstream_keepalive false;
    }
}
# darsana-ii.fullertonhealth.co.id/
upstream darsana-ii.fullertonhealth.co.id {
    # Container: darsana_ii_web_1
    #     networks:
    #         nginx-proxy (reachable)
    #     IP address: <IP_ADDRESS>
    #     exposed ports: 80/tcp
    #     default port: 80
    #     using port: 80
    server <IP_ADDRESS>:80;
}
server {
    server_name darsana-ii.fullertonhealth.co.id;
    access_log /var/log/nginx/access.log vhost;
    listen 80 ;
    listen 443 ssl http2 ;
    # No certificate found for this vhost, so use the default certificate and
    # return an error code if the user connects via https.
    ssl_certificate /etc/nginx/certs/default.crt;
    ssl_certificate_key /etc/nginx/certs/default.key;
    if ($https) {
        return 500;
    }
    include /etc/nginx/vhost.d/default;
    location / {
        proxy_pass http://darsana-ii.fullertonhealth.co.id;
        set $upstream_keepalive false;
    }
}

# configuration file /etc/nginx/vhost.d/default:
## Start of configuration add by letsencrypt container
location ^~ /.well-known/acme-challenge/ {
    auth_basic off;
    auth_request off;
    allow all;
    root /usr/share/nginx/html;
    try_files $uri =404;
    break;
}
## End of configuration add by letsencrypt container

# configuration file /etc/nginx/conf.d/proxy-settings.conf:
proxy_connect_timeout       300;
proxy_send_timeout          300;
proxy_read_timeout          90m;
send_timeout                300;

client_max_body_size        5000m;

nginx: configuration file /etc/nginx/nginx.conf test is successful

Containers logs
docker-gen.txt
nginx.txt
acme-companion.txt
Docker host

OS: Ubuntu 22.04.1 LTS
Docker version:

Client: Docker Engine - Community
 Version:           24.0.2
 API version:       1.43
 Go version:        go1.20.4
 Git commit:        cb74dfc
 Built:             Thu May 25 21:51:00 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.2
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.4
  Git commit:       659604f
  Built:            Thu May 25 21:51:00 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

same error for me :cry:


updating componentsets with new Zulu, Tomcat, Jetty; also versioning …

…preferencesets.xml (porting from Eclipse Toolkit)

Created new PR 376. Hence closing this one.


Side Nav: Cluster Badge colour fails to reach bottom of cluster badge

Setup

Rancher version: v2.9-head
Rancher UI Extensions:
Browser type & version:

Describe the bug

Cluster badge's background colour (bar at bottom of cluster badge) does not cover bottom of badge
This could just be for disabled clusters (create a custom rke2 cluster)

To Reproduce

If not easily reproducible with random clusters, create clusters as per screenshot (disabled clusters are custom rke2 clusters)

Result
see screenshot
Expected Result
badge colour goes to bottom of badge (size of badge should be the same as well)
Screenshots

Additional context
spun out from https://github.com/rancher/dashboard/issues/10662

Tests pass in https://github.com/rancher/dashboard/issues/10662, so I'm closing this issue as well.

I'm reopening this issue cause I could reproduce it on v2.9-e2023b437f3ccba16169b1e51db18419832ca5d7-head

Tests pass on v2.9-3ae1c6ac8d3524f8ded4544f1db75fc9e07911a5-head


I've been kicking the tires on the experimental testing/synctest feature. I have converted a few tests to use it successfully. But I am running into a panic issue: any test case that uses time.NewTimer or time.After and then time.Sleep panics, for example
func TestNewTimerCrashes(t *testing.T) {
	synctest.Run(func() {
		t1 := time.NewTimer(time.Second)
		time.Sleep(2 * time.Second)
		<-t1.C
	})
}

What did you see happen?
panic: timer moved between synctest groups

What did you expect to see?
I would expect this test to succeed, pretty much immediately due to synctest stubbing out the Sleep.
If I use time.NewTicker instead, then it does succeed, as long as I Stop() that ticker (see this other issue)

Related Issues

testing: "panic: Log in goroutine after Test..." is unreliable due to lack of synchronization on t.done #67701
runtime: new timer causes racy use of timer #35394 (closed)
sync: apparent deadlock in TestWaitGroupMisuse3 #35774 (closed)
runtime/pprof: panic: test timed out after 9m0s #52916 (closed)
cmd/internal/test2json: test timeout panic trace is attributed to the running test, even if the test just passed #57305
testing: inconsistent behaviors between running tests directly and after compiling the code first #59879 (closed)
sync: test timeout with -cpu=10 #19476 (closed)
runtime: "panic holding locks" when adding a timer #25619 (closed)
time: TestTicker timeouts after CL 232298 #42424 (closed)
testing: stack unavailable when a parallel test times out #18042 (closed)

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

CC @neild

Thanks for the report! Should be fixed now.


💡[FEATURE]: Predictive Maintenance for Financial Services Infrastructure

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Description: Predict maintenance needs for IT infrastructure in financial services.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Key Techniques: LSTM for time series forecasting, DNN for failure prediction, and feature engineering from maintenance logs.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.

pls @Akshat111111 assign it me


Replace URL: Keeps original

Steps to Reproduce

Paste a URL
Change it for another
Post: BS includes the new link in the post… but displays the orginal linked page

Attachments
No response
What platform(s) does this occur on?
Web (Desktop)
Device Info
No response
What version of the app are you using?
Web as of 09 Dec 2024
Additional Information
No response

I believe this is "working as expected", but it's indeed unintuitive.
In my opinion, link posting should work like this:

On post composer, type or paste a link;
The OPTION of putting a link card embed appears. Pressing "post" button immediately here will NOT add the embed in the post;
If you click on the link card embed, then it will REMOVE the typed link and ADD the embed, effectively replacing the text and saving up characters.

Because this is a more deliberate process, it prevents accidental link embedding and also prevents wrong link embeds from remaining in the post. In other words, making it "less automated" reduces error while also remaining fairly intuitive for usage.
Mentions: #6990, #5525


Picom

Can picom work with berry?

On the same computer I install Bspwm with same picom application and same picom configuration.

This is a known issue and is an artifact of the way that berry draws window decorations. Decorations in berry are simply larger "fake" windows drawn behind each application. It would certainly be possible to refactor berry to use a more complex decoration scheme which doesn't do this, but it's not something I will have time to implement soon. I'm always open to reviewing PRs should someone else implement this...


[10.x] Implement the support for model casts in assertDatabaseHas

Before
let's say you have a model with casted attributes
class Product extends Model {
    public $casts = [
        'options' => 'array'
    ];
}

testing this model with assertDatabaseHas method was like this:
$this->assertDatabaseHas(Product::class,[
    'name' => 'Product 1',
    'options' => json_encode([
        'option1',
        'option2',
        'option3',
        'option4',
    ])
]);

After
the tests should look like this without manually casts the attributes:
$this->assertDatabaseHas(Product::class,[
    'name' => 'Product 1',
    'options' => [
        'option1',
        'option2',
        'option3',
        'option4',
    ]
]);

Description
This pull request adds support for model casted data parsing in the assertDatabaseHas method to handle casted attributes in the model. The modified method will automatically cast the provided data based on the model's casts before making the database assertion.
Changes Made

Added a new parseData method in the CustomDatabaseAssertions trait to handle data parsing.
Updated the assertDatabaseHasWithParsedData method to use the parseData method for automatic casting.
Added relevant test cases to ensure the new functionality works as expected.

Motivation and Context
Currently, when using the assertDatabaseHas method with nested arrays, the data is not automatically cast based on the model's casts, resulting in test failures. This pull request addresses this issue by introducing the parseData method, which automatically casts the attributes using the model's casts.
This enhancement will improve the testing experience and allow developers to use the assertDatabaseHas method more effectively when dealing with complex data structures.
Testing Done

Added unit tests to cover the new parseData and assertDatabaseHasWithParsedData methods.
Ran the entire test suite and verified that all tests pass successfully.

Checklist

[x] Tests added to cover the changes
[x] Code follows Laravel coding standards

Does this not break tests for people already working around using json_encode?

I'll check it out

Please mark as ready when tests pass again, thanks.

i've tried to check if the given data is properly casted with it's types and to do so i had to add a method inHasAttributes Trait isAttributeValueCastedProperly

i don't know why these tests are failing there is nothing has to do with my code

Why so many StyleCI commits? You can download and directly apply the diff that StyleCI wants to apply, instead of eyeballing it. Alternatively, you can just leave it failing, and StyleCI will merge its fixes if and when this PR is merged.

Why so many StyleCI commits? You can download and directly apply the diff that StyleCI wants to apply, instead of eyeballing it. Alternatively, you can just leave it failing, and StyleCI will merge its fixes if and when this PR is merged.

Thank you very much

@khaledw62 can you rebase with 10.x and try again please?

Feel free to resend this with passing tests, thanks.


[Bug] Resource 'elasticstack_fleet_package_policy' does not permit policies with zero inputs

Describe the bug
The resource elasticstack_fleet_package_policy does not allow the deployment of package policies with zero inputs; specifically a package policy for the Elastic Agent package. The Elastic Agent package requires no configuration, thus no inputs. This could be considered a feature request since the behavior is expected, but I have issued it as a bug since the resource doe not handle all possible scenarios.

    {
      "id": "78d6f340-2fd0-11ee-8e61-b7fe88cXXXXX",
      "version": "WzE5MDE3LDdd",
      "name": "elastic_agent-1",
      "namespace": "default",
      "description": "",
      "package": {
        "name": "elastic_agent",
        "title": "Elastic Agent",
        "version": "1.10.0"
      },
      "enabled": true,
      "policy_id": "b2c90fc0-2fa3-11ee-8e61-b7fe88c46c49",
      "inputs": [],
      "revision": 2,
      "created_at": "2023-07-31T18:31:32.840Z",
      "created_by": "XXXX",
      "updated_at": "2023-07-31T19:14:10.250Z",
      "updated_by": "XXXX"
    },

To Reproduce
Steps to reproduce the behavior:

TF configuration used '...'

resource "elasticstack_fleet_package_policy" "sample" {
  agent_policy_id = var.agent_policy_id
  dynamic input {
    for_each = local.inputs
    content {
        enabled      = input.value.enabled
        input_id     = input.value.input_id
        streams_json = input.value.streams_json
        vars_json    = input.value.vars_json
    }
  }
  name            = var.name
  namespace       = var.namespace
  package_name    = var.package_name
  package_version = var.package_version

  description = var.description
  enabled     = var.enabled
  force       = var.force
  policy_id   = var.policy_id
  vars_json   = local.vars_json
}

Where local.inputs is an empty list

TF operations to execute to get the error '...' [e.g terraform plan,terraform apply, terraform destroy]
terraform plan
See the error in the output '...'

╷
│ Error: Insufficient input blocks
│
│   on modules/fleet_package_policy/main.tf line 1, in resource "elasticstack_fleet_package_policy" "sample":
│    1: resource "elasticstack_fleet_package_policy" "sample" {
│
│ At least 1 "input" blocks are required.
╵
ERRO[0021] 1 error occurred:
        * exit status 1

This has also been attempted with an empty input block which results in the following:
╷
│ Error: Missing required argument
│
│   on modules/fleet_package_policy/main.tf line 14, in resource "elasticstack_fleet_package_policy" "sample":
│   14:     content {}
│
│ The argument "input_id" is required, but no definition was found.
╵
ERRO[0024] 1 error occurred:
        * exit status 1

Expected behavior
A clear and concise description of what you expected to happen.
The resource be deployed without any inputs defined
Debug output
Run terraform command with TF_LOG=trace and provide extended information on TF operations.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):

OS: [e.g. Linux]
Terraform Version [e.g. 1.0.0]
Provider version [e.g. v0.1.0]
Elasticsearch Version [e.g. 7.16.0]

Additional context
Add any other context about the problem here.

@taylor-swanson if you get a chance to take a look here.


cx.consume_context::<RouterService>() already borrowed

Package related : web
Context: runtime
I have a runtime error stating that cx.consume_context::<RouterService>() is already borrowed.
I know where in my code it has been borrowed but how to release and avoid this runtime error?
It happens in this piece of code:
onclick: move |_| {
    cx.consume_context::<RouterService>().as_ref().unwrap().push_route("/")
}

I'm using consume_context in another component of my app so I understand the error but how avoid this already borrowed runtime error?

Ah, calling consume_context in a handler can lead to two parts of Dioxus-Core trying to open the RefCell at the same time. So it's not an issue with having two handles to routerservice, but rather something internal to dioxus that trips this issue.
Try caching the context instead of consuming it every time. We actually provide this as a hook:
let service = use_context<RouterService>(&cx)?;

Ah, calling consume_context in a handler can lead to two parts of Dioxus-Core trying to open the RefCell at the same time. So it's not an issue with having two handles to routerservice, but rather something internal to dioxus that trips this issue.
Try caching the context instead of consuming it every time. We actually provide this as a hook:
let service = use_context<RouterService>(&cx)?;

Thanks. I'm still getting the same error using your solution:
let service = use_context::<RouterService>(&cx).unwrap().clone();
let current_path = service.read().current_location().path().to_string();

Do I have to kind of release the borrow? Not sure if I'm doing it properly.

Do you have the exact error / traceback that goes along with this? I can't tell if it's a refcell inside of dioxus core (it shouldn't be) or if it's inside the RouterService.

Here is the traceback:
panicked at 'already borrowed: BorrowMutError', /home/elios/.cargo/git/checkouts/dioxus-1e619ce595d3799d/fbb610d/packages/core/src/scopes.rs:809:39

Stack:

init/imports.wbg.__wbg_new_693216e109162396@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3.js:472:15
console_error_panic_hook::Error::new::h8c67634336dfe68d@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[8663]:0x20fe46
console_error_panic_hook::hook_impl::hf1488c0c46daa81b@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[948]:0x109216
console_error_panic_hook::hook::hba9102b38abbfd08@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[9453]:0x21add5
core::ops::function::Fn::call::h8cb477c546fef3f3@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[8040]:0x206451
std::panicking::rust_panic_with_hook::h47a0e203360b6c10@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[2010]:0x156d53
std::panicking::begin_panic_handler::{{closure}}::h888144d5e9a03cec@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[3736]:0x1a1411
std::sys_common::backtrace::__rust_end_short_backtrace::h81961607fd97e28e@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[11422]:0x22de19
rust_begin_unwind@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[9147]:0x216c59
core::panicking::panic_fmt::h4ca53049f45e3264@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[10034]:0x2221f4
core::result::unwrap_failed::h6d050dbd00b66340@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[4203]:0x1b01e8
core::result::Result<T,E>::expect::h07b85de9cea6910c@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[2918]:0x18319d
core::cell::RefCell<T>::borrow_mut::hc95836ced9388326@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[3416]:0x19635c
dioxus_core::scopes::ScopeState::use_hook::h6a6d8f38eacfc398@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[301]:0x8ddaf
dioxus_hooks::use_shared_state::use_context::hf9b8fb9ea5533e43@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[747]:0xf28d8
frontend_dioxus::nav::MainNav::{{closure}}::hb5c284993c91f7ee@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[678]:0xe9587
dioxus_core::scopes::ScopeState::use_hook::hd345b3014c9d3552@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[335]:0x9d382
frontend_dioxus::nav::MainNav::h1211170b8079a5f0@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[439]:0xbd447
<dioxus_core::nodes::VComponentProps<P> as dioxus_core::nodes::AnyProps>::render::hb8f149a007524ae1@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[3440]:0x1970e5
dioxus_core::scopes::ScopeArena::run_scope::he5728b9d39c70594@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[207]:0x3a5dc
dioxus_core::diff::DiffState::create_component_node::hf842e1f99784df4f@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[464]:0xc3849
dioxus_core::diff::DiffState::create_node::h926adff19c04e524@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[1753]:0x147b5c
dioxus_core::diff::DiffState::work::h1af8021066f64d6d@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[476]:0xc62a8
dioxus_core::virtual_dom::VirtualDom::rebuild::h3b5bddbebbf64a05@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[602]:0xddad8
dioxus_web::run_with_props::{{closure}}::hf4493d155d387308@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[203]:0x34a81
<core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h30eebc382f9e72b7@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[2640]:0x176e51
wasm_bindgen_futures::task::singlethread::Task::run::he78734f0bcd1016c@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[715]:0xee730
wasm_bindgen_futures::queue::QueueState::run_all::hb31a9be53ca10a90@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[835]:0xfd058
wasm_bindgen_futures::queue::Queue::new::{{closure}}::h90db50e0b0c5d0a4@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[5447]:0x1d1f1b
<dyn core::ops::function::FnMut<(A,)>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::hc4406847996ccef4@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[2275]:0x16513c
__wbg_adapter_40@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3.js:256:10
real@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3.js:200:20
promise callback*init/imports.wbg.__wbg_then_a6860c82b90816ca@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3.js:1105:31
js_sys::Promise::then::hb6eb8f270e8d859f@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[5197]:0x1cbb28
wasm_bindgen_futures::queue::Queue::push_task::h951583a4af05f020@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[1145]:0x11b5be
wasm_bindgen_futures::task::singlethread::Task::wake_by_ref::{{closure}}::h43358f3220e6909f@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[7341]:0x1fa22b
std::thread::local::LocalKey<T>::try_with::h786f3f3f1dd1f491@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[2223]:0x1625f7
std::thread::local::LocalKey<T>::with::hc8c77056f3b09f64@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[4978]:0x1c603e
wasm_bindgen_futures::task::singlethread::Task::wake_by_ref::h1acf6925ccaceaca@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[2772]:0x17cd2e
wasm_bindgen_futures::task::singlethread::Task::spawn::h086eb5fd78fe1c9c@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[518]:0xceddf
wasm_bindgen_futures::spawn_local::h477735685cfd1adf@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[3312]:0x1927c0
dioxus_web::launch_with_props::hd91c8187aed65625@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[1254]:0x1244e2
dioxus_web::launch::hb12fbc42a771cf12@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[9416]:0x21a56a
frontend_dioxus::main::h4fb33d8a31fb2eba@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[3204]:0x18e7fb
core::ops::function::FnOnce::call_once::hb0428e5e9208d24b@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[9309]:0x218f92
std::sys_common::backtrace::__rust_begin_short_backtrace::h01d4df32df54ee4a@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[9151]:0x216d26
std::rt::lang_start::{{closure}}::hde1d307a1eb8f161@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[8016]:0x205e48
std::rt::lang_start_internal::h7fe18c3b03c68b12@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[2290]:0x165d8d
std::rt::lang_start::h9f29a105cb543caf@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[3977]:0x1a90e6
main@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[11356]:0x22d8c9
@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3_bg.wasm:wasm-function[11479]:0x22e1ce
init@http://<IP_ADDRESS>:8080/index-c2d25689c6ca41a3.js:1199:6
async*@http://<IP_ADDRESS>:8080/:12:51

Actually, when I comment this out, I don't have the borrow error. My aim is to get the title set when first rendering. The code I use is this one:
cx.use_hook(|_| {
    let service = use_context::<RouterService>(&cx).unwrap().clone();

    let current_path = service.read().current_location().path().to_string();
    if *use_read(&cx, IS_AUTHENTICATED) {
        setTitle::<PrivateRoute>(current_path.as_str());
    } else {
        setTitle::<PublicRoute>(current_path.as_str());
    }
});

Ok. The issue was with cx.use_hook. Misused it maybe. Without it it  works as expected.

Oh, the issue is having use_read inside of use_hook. The init function is only ran once so you're loading a hook in a conditional. You can just move the use_read out of the conditional and things will start working.

@jkelleyrtp I'm again having this issue but with use_shared_state. Looks like I'm not using it properly.

@jkelleyrtp I'm again having this issue but with use_shared_state. Looks like I'm not using it properly. I'm doing something like this:
let auth_state = use_context::<AuthContext>(&cx).unwrap();
cx.render(rsx! {
    NavEndWrapper {
        div {
            class: "buttons",
            Link { to: "{path}", class: "button is-primary", "{title}" },
            a {
                class: "button is-danger",
                prevent_default: "onclick",
                onclick: move |_| {
                    auth_state.write().is_authenticated = !auth_state.read().is_authenticated;
                },
                "Logout"
            }
        }
    }
})

The error happens here: hooks/src/use_shared_state.rs:138:20. I'm doing something similar in another place (a .write) so I think is either we should find a way to release the BorrowMut after the write is performed, either I'm not using use_context properly in regards of my use case and I should do another way. I was using fermi but I preferred to switch to use_context for kind of the same thing because looks like scope of both package are incompatible at this time if I'm not mistaken.

This is the suspect line:
                    auth_state.write().is_authenticated = !auth_state.read().is_authenticated;

RefCells in Rust cannot be both read() and write() at the same time. Fermi saves data immutably so you can use old values to set new values. The way to solve this for ^ your properly is either:

extract is_authenticated out to a dummy variable
make a method on auth_state that takes an &mut and does the logic internally.

@jkelleyrtp got it. It worked thanks


Feature/BE-180 improve code quality

Current coverage is 66.52%

Merging #54 into master will increase coverage by +7.99% as of 0622db7

@@            master     #54   diff @@
======================================
  Files           45      49     +4
  Stmts         1951    2046    +95
  Branches       178     179     +1
  Methods          0       0
======================================
+ Hit           1142    1361   +219
- Partial          8      17     +9
+ Missed         801     668   -133

Review entire Coverage Diff as of 0622db7

Uncovered Suggestions

+0.78% via .../models/receiving.py#92...107
+0.73% via .../models/receiving.py#74...88
+0.68% via ...views/sales_order.py#143...156
See 7 more...

Powered by Codecov. Updated on successful CI builds.