Fix - Getting RBR for a workspace connection sync on a workspace I’m not an admin of

Details

Fixed Issues

$ https://github.com/Expensify/App/issues/52321
PROPOSAL: https://github.com/Expensify/App/issues/52321#issuecomment-2468940641
Tests

Create workspace and connect it to QBO
Invite a user as a non-admin
Log into QBO and disconnect the Expensify app
Step 3 will Cause a sync error
Log in as member (Invited in step 2)
Verify that you don't see RBR as the member is non-admin

[x] Verify that no errors appear in the JS console

Offline tests

Same as above
QA Steps

Same as above

[x] Verify that no errors appear in the JS console

PR Author Checklist

[x] I linked the correct issue in the ### Fixed Issues section above
[x] I wrote clear testing steps that cover the changes made in this PR

[x] I added steps for local testing in the Tests section
[x] I added steps for the expected offline behavior in the Offline steps section
[x] I added steps for Staging and/or Production testing in the QA steps section
[x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
[x] I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).

[x] I included screenshots or videos for tests on all platforms
[x] I ran the tests on all platforms & verified they passed on:

[x] Android: Native
[x] Android: mWeb Chrome
[x] iOS: Native
[x] iOS: mWeb Safari
[x] MacOS: Chrome / Safari
[x] MacOS: Desktop

[x] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
[x] I followed proper code patterns (see Reviewing the code)

[x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
[x] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[x] I verified that comments were added to code that is not self explanatory
[x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method

[x] If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:

[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

[x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[x] I followed the guidelines as stated in the Review Guidelines
[x] I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
[x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[x] I verified that if a function's arguments changed that all usages have also been updated correctly
[x] If any new file was added I verified that:

[x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[x] If a new CSS style is added I verified that:

[x] A similar style doesn't already exist
[x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))

[x] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[x] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
[x] If the PR modifies the form input styles:

[x] I verified that all the inputs inside a form are aligned with each other.
[x] I added Design label so the design team can review the changes.

[x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[x] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native

Android: mWeb Chrome

iOS: Native

iOS: mWeb Safari

MacOS: Chrome / Safari

MacOS: Desktop

@thesahindia It is not getting fixed with merging main but it is unrelated so we can proceed 👍

@thesahindia The test failing log indicate it is related to node version which it is internal github issue occurring in other pr's too. I have again merged main but not getting fixed. U can proceed with your review 👍

@thesahindia The test failing log indicate it is related to node version which it is internal github issue occurring in other pr's too. I have again merged main but not getting fixed. U can proceed with your review 👍

@FitseTLT, try running the tests locally. I am only seeing the errors when applying the changes of this PR.

Very sorry @thesahindia now I see it is related to the PR, I thought it was like my other PRs b/c they were failing. Will fix it and ping you. Thx

@thesahindia Fixed tests and also added some more related to our PR 👍

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.


CREO2URDF – linkFrames does not handle the option frameReferenceLink

I just realized that the suboption frameReferenceLink of linkFrames is not handled

https://github.com/search?q=repo%3Aicub-tech-iit%2Fcreo2urdf+frameReferenceLink&type=code

cc @mfussi66

Hi @Nicogene  just a question - is this issue intended to be for Team DEV, or was is simply a mistake? Thx ciao

Hi @andreaderito I added by mistake sorry, either me or @mfussi66 can work on this in case of spare time


Allow photo refresh from the carousel

What

[ ] Allow photo refresh from the carousel

Part of

#503

Mockup

Hi @teolemon
I want to work on this. Can you please detail me about what needs to done?
As of now, I'm thinking about adding a reload/refresh button and on its click and I'll reload the images widget.

It's taking a new picture and uploading it to replace the existing one, not refreshing from server.

I advocate implementing https://github.com/openfoodfacts/smooth-app/issues/1244 instead (it's also less invasive in the interface).

I advocate for this one. This is the way to actually get the data we need.

I'm not advocating anything, but the proposed mockup is very confusing for users: unless you know that the first photo is supposed to be the front photo, the second is supposed to be the ingredients etc. it's very difficult to understand why there's a different button on each photo.
When we don't have a photo at all, there's a "Add an ingredients photo" (or similar) text that makes it obvious.
The solution proposed in #1244 would make things much more clear I think.

We need to do data refresh, and we need to do it hard and fast. Thus this solution which is easier to understand than scrolling left, including on a typically very wide photo of ingredients.
A grand total of 0 users is sliding left on the carousel to the "Add more interesting photos" button.

My comments:

how do you currently do that on the Android version?
I understand the need (expressed in this issue) of a fast-track action for picture refresh
I detect confusion around the purpose of each photo, because the fast-track mode doesn't do everything and is not verbose (that's because it's only a fast-track)

My suggestions:

keep the carousel of pictures of the OP but perhaps change the icon to a more standard  (or a custom combination of camera and refresh). For an end-user, the idea is to retake the picture (e.g. because it's blurred): the fact that it's going to be an additional picture for the same type (front, ingredients, ...) is not relevant for the user. And the camera icon means that we take a picture.
add a vertical banner to the right side (as a Stack child, always on top of the carousel), with a photo library icon  that would open a new "photo manager" page with detailed actions

Frankly there is no way users will understand that the Camera icon (with a + or not) means that their photo will replace the selected photo. So we will end up with any photo being selected as anything.
The best solution is to have 1 single photo camera icon (e.g. on the top right corner) that opens the dialog to add more photos of a specific type. (in fact I remember it was proposed before).
If the aim is to have newer photos, then there are much more effective ways to convey that to users: just display a prompt in the product card "Our image of ingredients is a bit old, could you take a new one?", a bit like the robotoff prompts.

Ok, but maybe we can do both ? (as told this scenario is not covering the case where there is no "ingredients" photo yet).

When there is no ingredient photo, there is a prompt to upload the photos of ingredients, and the text makes it very clear we want the photo of ingredients.

I think it was fixed in #3023
Can you have a look here @M123-dev

I guess the whole Gallery was a step in the right direction and I have to say I don't like the looks of a button on every image, but let's ask @teolemon what do you think is the Gallery when clicking on a image enouph

We can close it. I'm still annoyed by the usability of this carousel though, but we have more important topics


Setup a TG CI pipeline and run post commit tests

We need a TG CI machine that runs post commits tests specific to TG system.
Galaxy bringup is happening on branch: galaxy/main.
We should setup post commit test runs when changes are pushed to galaxy/main.
To start, we can enable single chip tests that run on mmio chip as well as remote chip.

One thing to note, it might be a good idea to continuously merge branch into main and not let it drift, so we stay updated to tip.

This is needed, however please do not do what fd-2 did last time and have a giant, diverging branch. Please merge into main often as @tapspatel said.
We want to discourage this method of development, and encourage iterative development. You can gate things behind DEFINEs during compilation
@tapspatel will be looking into tg pipeline (should be main already with no tests)

Merged: dc8c35ace42e062a13d95b2d0701578f89c7d6b1

Currently, TG CI has 8 hugepages, need to upgrade to 16 (4 per MMIO). @tapspatel

fixing...

Fixed: 16 pages per TG and TGG (as UMD only supports 4 per mmio device currently). Will need
tg needs 36
tgg needs 72
once UMD support for it lands. closing.


feat: reintroducing the complete language server

closes #3942, closes #3962
We migrated to the TS plugin in 2.0 to resolve many issues with v1, unfortunately it had many issues with compatibility:

VSCode <= 1.87 bundled Node version breaks tsserver + @vue/typescript-plugin in some environments.
Even if @vue/typescript-plugin only provides vue virtual code and handles mapping, it still causes performance problems in tsserver in some TS versions.
Whenever any TS plugin crashes in a .vue file, it will cause @vue/typescript-plugin to be invalidated and make intellisense completely wrong. This is a fault-tolerance problem of the TS LS plugin architecture.

These issues are beyond our control, so we reintroduced the v1 complete LSP server and only switched to Hybrid Mode when explicitly enabled by the user.

@johnsoncodehk
That was hard time
Thank you for your work

So what's the recommended setup for TypeScript users now? Do we need the extra VSC extension again?

@Stanzilla No, you just need the Vue - Official plugin.

@Stanzilla No, you only need the Vue - Official plugin.

And Hybrid Mode enabled, right? Would make more sense if this was called something like enable TypeScript support maybe?

And Hybrid Mode enabled, right? Would make more sense if this was called something like enable TypeScript support maybe?

If you have TS 5.3+ installed and have a tsconfig.json or jsconfig.json, feel free to enable it.

if this was called something like enable TypeScript support maybe

Not exact. "Hybrid Mode" means Vue Language Tools makes the built-in TS service to run on .vue files, and if you disable hybrid mode we a two separate TS language server on .vue files.

Would be very helpful to have a comparison table of two solutions/approachers. Not being much experienced in tooling for JS I struggle to see how to chose what to do, enable hybrid mode? Disable it? What are the benefits of each approach? Downsides?

Would be very helpful to have a comparison table of two solutions/approaches. Not being much experienced in tooling for JS I struggle to see how to chose what to do, enable hybrid mode? Disable it? What are the benefits of each approach? Downsides?

Yes exactly, it's very unclear atm

Maybe this can help : https://gist.github.com/johnsoncodehk/62580d04cb86e576e0e8d6bf1cb44e73


Mistake in Spin 1/2 operator Sy

https://github.com/ITensor/ITensors.jl/blob/72b0bd9b2c9c2f37d311a4e3958f20d08ad7c069/src/physics/site_types/spinhalf.jl#L39-L45
There is a non-canonical definition of the Pauli matrix \sigma_y; it has a sign error with respect to the canonical definition [1,2]:

Obviously, this is only noticeable in operators which are odd in \sigma^y and thus this might be a mild bug. However, I wish to argue that we should fix the sign in order to not throw the commutation relations

over board as they indeed define the Pauli matrices in a basis-independent way. NB: Anti-commutation relations are still valid under \sigma^y -> -\sigma^y (even in \sigma^y).
Currently, the commutation relations do not hold.
Moreover, \sigma^+ and \sigma^- would have to change role as

https://github.com/ITensor/ITensors.jl/blob/72b0bd9b2c9c2f37d311a4e3958f20d08ad7c069/src/physics/site_types/spinhalf.jl#L32-L35
Cheers,
Jan
[1] W. Pauli, „Zur Quantenmechanik des magnetischen Elektrons", Zeitschrift für Physik, Bd. 43, 1927, S. 601, DOI: 10.1007/BF01397326
[2] Pauli matrices, Wikipedia (en), visited: 05/12/2019 at 17:00UTC+1

I propose a fix with Pull Request https://github.com/ITensor/ITensors.jl/pull/153 .

Thanks Jan, however I believe you are reading the matrices in a transposed way relative to how the code operates. With the ITensor system, the line of code:
Op[Dn, UpP] = -0.5*im
has exactly the same effect as the line of code
Op[UpP, Dn] = -0.5*im
That is, the order of the indices does not matter. But I can see that it's confusing how I wrote them in the reverse order from the usual row,column ordering. (I think I was thinking in a left-to-right "down maps to up" fashion when I wrote that code.)
So actually the existing code does agree with the canonical definition of the Pauli y matrix.
I think a good correction, though, would be to reverse the order of the Up,Dn,UpP,DnP arguments throughout that whole code so that it is less confusing to read though.

Hi Miles,
Consider the following test:
julia> using ITensors

julia> sites = ITensors.siteinds("S=1/2", 1)
1-element Array{Index,1}:
 (2|id=217|S=1/2,Site,n=1)

julia> Sx = op(sites[1], "Sx"); Sy = op(sites[1], "Sy"); Sz = op(sites[1], "Sz");

julia> @show Sx
Sx = ITensor ord=2 (2|id=90|S=1/2,Site,n=1) (2|id=90|S=1/2,Site,n=1)'
Dense{Float64,Array{Float64,1}}
2×2 Tensor{Float64,2,Dense{Float64,Array{Float64,1}},IndexSet{2}}:
 0.0  0.5
 0.5  0.0
ITensor ord=2 (2|id=90|S=1/2,Site,n=1) (2|id=90|S=1/2,Site,n=1)'
Dense{Float64,Array{Float64,1}}

julia> @show Sy
Sy = ITensor ord=2 (2|id=90|S=1/2,Site,n=1) (2|id=90|S=1/2,Site,n=1)'
Dense{Complex{Float64},Array{Complex{Float64},1}}
2×2 Tensor{Complex{Float64},2,Dense{Complex{Float64},Array{Complex{Float64},1}},IndexSet{2}}:
  0.0+0.0im  0.0+0.5im
 -0.0-0.5im  0.0+0.0im
ITensor ord=2 (2|id=90|S=1/2,Site,n=1) (2|id=90|S=1/2,Site,n=1)'
Dense{Complex{Float64},Array{Complex{Float64},1}}

julia> @show Sz
Sz = ITensor ord=2 (2|id=90|S=1/2,Site,n=1) (2|id=90|S=1/2,Site,n=1)'
Dense{Float64,Array{Float64,1}}
2×2 Tensor{Float64,2,Dense{Float64,Array{Float64,1}},IndexSet{2}}:
 0.5   0.0
 0.0  -0.5
ITensor ord=2 (2|id=90|S=1/2,Site,n=1) (2|id=90|S=1/2,Site,n=1)'
Dense{Float64,Array{Float64,1}}

julia> @show Sx*Sy' - Sy*Sx'
Sx * Sy' - Sy * Sx' = ITensor ord=2 (2|id=90|S=1/2,Site,n=1) (2|id=90|S=1/2,Site,n=1)''
Dense{Complex{Float64},Array{Complex{Float64},1}}
2×2 Tensor{Complex{Float64},2,Dense{Complex{Float64},Array{Complex{Float64},1}},IndexSet{2}}:
 0.0-0.5im  0.0+0.0im
 0.0+0.0im  0.0+0.5im
ITensor ord=2 (2|id=90|S=1/2,Site,n=1) (2|id=90|S=1/2,Site,n=1)''
Dense{Complex{Float64},Array{Complex{Float64},1}}

The line julia> @show Sy offers a view of the implemented Sy operator and it is indeed printed as the non-canonical version. Additionally, julia> @show Sx*Sy' - Sy*Sx' yields a view on the result of the commutator Sx Sy - Sy Sx which is indeed -Sz.

Hi Jan, yes this printout does show it in reverse order from the canonical version, but in ITensor the definition of a tensor is independent of the index ordering. So here the reason you see the reverse order of the elements is because the indices are ordered as column, row rather than row, column (in the sense of mapping onto the standard row and column indices of the Pauli matrices).
In ITensor, our convention is that the unprimed index is the “bra” index i.e. the column index, whereas the primed index is the “ket” index so the row index. So it’s confusing here because I ordered the indices backwards from the usual row, column ordering which is standard for matrices, however the definition of an ITensor is invariant to this ordering (although the printout is not, which is why we also print the indices).
Best regards,
Miles

The issue you filed is very appreciated by the way. Based on your issue I will go through and change the ordering of the operator indices in the S=1/2 and similar parts of the code so that the printouts follow the standard row, column ordering.

Oh, I see, so in fact the printout would be transposed as well as matrix(op(sites[1],"Sy"))...
I'm sorry, I completely forgot about the unprimed <-> bra, primed <-> ket convention.


Please activate Appveyor CI on this project

This would prevent breaking Windows build by accident like here: https://github.com/sparklemotion/sqlite3-ruby/commit/f4ffec281a2888c1e536662ac1ea740fd3f5433c
I think @MSP-Greg and me can help to keep appveyor.yml up-to-date.

I'll do this as part of the refresh of native gems in #320

See #320 for a commit configuring appveyor


Add supplements and attachments to cred issue message

This PR adds the supplements and attachments to the cred issue message. @frostyfrog this notably does NOT include the fix that we discussed. As it turns out, it would seem the attachment decorator was explicitly excluded from the base message decorator set since it's not defined to be a decorator that can be added to any message. Instead, the right choice was actually to make it a field of the message and just set the data key to ~attach and then the decorator extractor knows to skip it since it's a defined field on the schema of the message.
Also of note, there's an unfortunate overlap in terminology with the base credentials~attach field and access a specific format of the credential from that list. When consuming these changes, be careful to retrieve the generic attachments with cred_issue.attachments which will have the type Sequence[AttachmentDecorator] and not to mix this up with the method cred_issue.attachment(format) which does something very different. We're considering renaming that method to something else but opted to not do that yet for a cleaner change set here.

What is the purpose of the MessageType value?

Cleaner deserialize typing. Definitely not strictly necessary but having the type hints correctly aware of the type of the object returned from deserialize is nice.


V3 rebased

Rebased with master and created new branch 2.0.0 https://github.com/rsksmart/tokenbridge/pull/199


Few questions and ideas

Hey, I just found this library, and it has exciting ideas. Thank you! I have a few questions, though.
I tried to reimplement your optimistic update example but moved the implementation into the mutation definition instead of using the hook instance (a similar question was raised in this issue #21). This implementation is more common because I want to have optimistic updates working for every instance of the hook, no matter how many times I use it in the app and don't copy over the implementation for every instance.
This is what I got  codesandbox
I found a few issues there:

When useDefaultOptions returns an options object, the onError/onSettle context type is inferred incorrectly (infers unknown instead of { previousTodos: Todos } - the return type of the onMutate callback.

If I remove useDefaultOptions and pass options to createMutation directly, the context type is inferred correctly.
createMutation({ mutationFn, onMutate, onError })  // correct context type
createMutation({ mutationFn, useDefaultOptions: () => ({ onMutate, onError }) })  // unknown context type

I think useDefaultOptions should receive the options object from the hook as an argument. Otherwise, if both options are used, the hook options override the ones from useDefaultOptions  and there's no way to access the options used in the hook instance. Make sure options don't override each other.

Using the optimistic update code as an example, I want to clear the input after a user clicks the add button:
const useAddTodo = createMutation({ mutationFn, useDefaultOptions: () => ({ onMutate, onError }) })
...
const addTodoMutation = useAddTodo({
  // When mutate is called:
  onMutate: async () => {
    setText("");
  },
});

If I do this, the onMutate from useAddTodo replaces the onMutate in createMutation.
If useDefaultOptions would receive options as an argument, it could be fixed like this:
const useAddTodo = createMutation({
  mutationFn, useDefaultOptions: (options) => ({
    onMutate: (newTodo) => {
      // optimistic update logic goes here
      // then you can run onMutate from useAddTodo()
      options?.onMutate?.(newTodo)
    }
  })
})

I like the shorthand setData for setQueryData with queryClient and queryKey built in. What do you think of adding other most used methods? Now your optimistic updates example looks inconsistent because it used a mixed API. It uses todosQuery.setData() but at the same time await queryClient.cancelQueries(todosQuery.queryKey); and queryClient.invalidateQueries(useTodos.getKey()).

It will be nicer if you expose other methods like getData for queryClient.getQueryData, invalidateQuery for queryClient.invalidateQueries etc.
I.e.
const { methods: { getData, setData, invalidateQuery } } = useTodos()

Maybe make it configurable so devs can decide which methods to expose.

It's minor but what's the logic of exposing queryKey as a hook return and getKey() as a static method? getKey seems self-sufficient for this purpose. queryKey does the same, but it makes API look inconsistent.

Seems that it is unable to infer the correct type for useDefaultOptions's context after i tried.

Cannot pass the hook options into useDefaultOptions. Cuz the hook options is the last options u pass in and it will override useDefaultOptions.

I don't want to add more built-in methods. It will add more complexity to this library. But setData is different, it let you to have a better typescript experience.

queryKey is the key of current query, and getKey is just a static method. If u using getKey do same thing, it will make more code. as bwlown

const todosQuery = useTodos()
queryClient.invalidateQueries(useTodos.getKey(todosQuery.variables))

Thanks for the reply!

Now you can using middleware to customize ur hook whatever u neeed.


edit http headers

Like angular $resource, can you add http header access?
It will help to set custom attributes in it.
Thanks

Yes, you can use $odataresource just like a normal $resource object.

OK I get it!
For the record, the resource must declare actions explicitely.
For example :
      var myRes = $odataresource('url', {}, {           odata: {               method: 'GET',               isArray: true,               headers: {                   'customAtt' : 'myCustomValue'               }           }       }, { odatakey: 'Id', isodatav4: true });
Perhaps, you can write it in documentation?
Thanks, very good work :)


Add a lock to guard concurrent map access in Renter.FileList

FileList reads the map, r.tracking, but does not acquire a read lock beforehand,
which leads to crashes. This adds a helper function that acquires the read lock
during the map read.
Fixes #2473

Our locking conventions mandate that unexported methods cannot acquire locks unless their name begins with managed. So one option would be to rename getTrackedFile to managedGetTrackedFile. In this case though, I think it would be simplest to just move the lock/unlock into the body of FileList.

Our locking conventions mandate that unexported methods cannot acquire locks unless their name begins with managed.

Do we have this documented? If not, I can file a bug to add it to Developers.md.

So one option would be to rename getTrackedFile to managedGetTrackedFile. In this case though, I think it would be simplest to just move the lock/unlock into the body of FileList.

That's what I tried originally, but then we end up with two different lock IDs in the same function, which makes me kind of antsy, even though they're pretty far from each other. I renamed to managedGetTrackedFile.

Hmm, I thought it was documented, but I guess not. The threaded convention is documented; managed is basically the same except not called in a goroutine.
@DavidVorick and I discussed awhile back whether threaded and managed should be merged, but I forget if we concluded anything definitively. For now, let's document that managed is for helper methods that need to manage their own locking, usually because they make some blocking call (disk I/O, network I/O, waiting on a channel, etc.)

With managed, the implication is that you are going to call the function synchronously (you don't have to, but the function has to be designed so that synchronous calling is acceptable). With threaded, the requirement is that the function be called asynchronously. Typically, threaded functions contain an infinite loop and run some background process, which means they return only after some signal and definitely can't be called synchronously. There are a few other use cases for threaded functions as well.
We should definitely keep them separate.


Bye bug requires multiple exit calls to actually exit

Thank you so much for this amazing gem! It is very helpful. I did want to point out an issue I have been experiencing that is a bit frustrating. Bye bug requires multiple exit calls to quit. I thought it was a fluke the first time it happened but it happens every time I use it now. Attached is a screenshot of the issue.

Hi @cantonyselim!
Some comments:

Please use the latest version of byebug. exit is no longer a supported command...
The command to exit is quit if you want a confirmation prompt or quit! if you want to exit right away.

Please upgrade and try to reproduce this again with quit. If it still doesn't work, reopen this issue, but I'm going to need a way to reproduce the issue since it certainly works in simple cases...

quit definitely works! My mistake, using the old syntax. Thank you!

No problem!


Proposal: SIMD Acceleration for BitPackFormatter

Process 32 elements at one time by using SIMD api.

thank you for great contribute!
merge and release soon.


Oracle Connection Timeout Polling High CPU

I can't find a configuration for Oracle that doesn't result in very high timeout polling CPU usage. I tried setting a very large value, also zero (which the implementation converts to Integer.MAX_VALUE). In all cases it idles with extremely high CPU usage.

I should have mentioned, this does not happen with other connection pools such as apache DBCP.

Can you clarify what you mean by "high timeout polling CPU usage"?  And can you post your current pool configuration?

After the first query in the running application has completed, CPU meters show it idling at ~50%. Attaching a profiler to the running process shows that the Oracle timeout polling thread is using all the CPU.
Here's the Spring configuration for my data source. As mentioned, I've tried several different values for the connectionTimeout property, all with the same result.

<!-- Datasource for standalone operation (jetty, tomcat etc). Will use JNDI to obtain from container if running inside Wildfly etc. -->
<bean id="datasource" class="com.zaxxer.hikari.HikariDataSource">
    <property name="driverClassName" value="${jdbc.driver.className}"/>
    <property name="jdbcUrl" value="${jdbc.url}"/>
    <property name="username" value="${jdbc.username}"/>
    <property name="password" value="${jdbc.password}"/>
    <property name="connectionTimeout" value="0" />
    <property name="connectionTestQuery" value="select 1 from dual" />
    <property name="poolName" value="default_pool" />
    <property name="registerMbeans" value="true" />
</bean>

Try configuring the pool without a connectionTestQuery, HikariCP will then use the JDBC 4.0 Connection.isValid() method to test connections.  If this does not address the issue, can you provide a thread-dump containing all HikariCP threads, as well as Oracle threads?

@Ed42 any update on this?


Python3 compatability

Needs an evaluation of fs 2.0's s3 implementation at https://github.com/PyFilesystem/s3fs


[BUG] Relative cimport from package without __init__.pxd fails

Describe the bug
Relative cimport from package without __init__.pxd fails - see example below (adding b/__init__.pxd will fix the compilation issue):
$ cython -3 a.pyx

Error compiling Cython file:
------------------------------------------------------------
...
from .b cimport aa
^
------------------------------------------------------------

a.pyx:1:0: 't/b.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
...
from .b cimport aa

cdef aa.ulong a = 5
     ^
------------------------------------------------------------

a.pyx:3:5: 'aa' is not declared

Code to reproduce the behaviour:
######## __init__.py ########

######## a.pyx ########
from .b cimport aa
cdef aa.ulong a = 5

######## b/__init__.py ########

######## b/aa.pxd ########
ctypedef long int ulong

Expected behaviour
The example is compiled successfuly even without b/__init__.pxd
OS
any
Python version
any
Cython version
3.0.1, 3.0.2, master
Additional context
Affecting: https://github.com/MagicStack/uvloop/pull/534
Possible introduced by: #5538

Oh, yes, that seems a serious regression. Targeting for 3.0.3 to make sure we keep it in sight.

Yes it is caused by following lines introduced in #5538:
https://github.com/cython/cython/blob/9827c6085e2141db71c55ae231a4a09a878dd524/Cython/Compiler/Main.py#L222-L224
Feel free to revert #5538 if needed.


ACCUMULO_JAVA_PREFIX in accumulo shell script not expanding correctly

The * subscript in ACCUMULO_JAVA_PREFIX at https://github.com/apache/accumulo/blob/38c261d1236f118ffc2c6eebc505f5daf12bf0e2/assemble/bin/accumulo#L86 is expanding the array to a single word separated by IFS. In testing, I believe @ should be used here instead.
Versions (OS, Maven, Java, and others, as appropriate):

Affected version(s) of this project: 2.10

To Reproduce
I wrote a script to test this out. The following fails:
ACCUMULO_JAVA_PREFIX=(
        '/usr/bin/numactl'
        '--all'
)

CMD=("${ACCUMULO_JAVA_PREFIX[*]}" "/usr/bin/java")

echo "${CMD[@]}"
exec "${CMD[@]}" "--version"

Changing * to @ on the line starting with CMD= allows the script to succeed.

I will continue to look into this to see if there's something we should do to change this, so you can use an array. But there are trade-offs here that make no option perfect. If we use an array, you can't export it, and if you unintentionally set a scalar when we expect an array, we might not parse it correctly. If we expect a scalar and split it on IFS, then that could be a huge problem for quoting, requiring a bunch of convoluted quoting escapes, and assumptions about how the args are flattened when our script uses the environment variable. There's a good chance that the best option is to leave it as-is, and interpret it as a single scalar, requiring users to put multiple arguments into a script as suggested above.

As it turns out, you can jump through hoops to effectively export an array variable, but it's not pretty:
BASH_ENV=<(echo "declare -a ACCUMULO_JAVA_PREFIX='(numactl --all)'") bin/accumulo

If you set the variable as an array in the environment, but then try to set it as a scalar in the script, then the scalar will only override the first item in the array. This can result in some confusing behavior. I added a sensible check with declare -p in my PR #3701 to fix this.


Add domain-oriented visibility via domain probe pattern

https://martinfowler.com/articles/domain-oriented-observability.html

This will help calling/implementing applications to gain introspection into what's going inside, e.g. the number of success/rejected/failures, etc.


Change ObjectGiveMoney to disallow payments of zero

This makes llGiveMoney compatible with its Second Life implementation.

I misread this commit at first, thinking it was allowing $0 transactions when in fact it's disallowing the money transfer of $0, skipping the transfer (as per function documentation).  There are two semantic changes by this:

A script that checks the return code will get a false/0 back now for $0 when it used to get true/1.
The notification of "You were paid Iz$ by user" is now skipped as well.
This will reduce messages and code executed.

This change should be completely safe although the first point above is the largest risk. However, since it always returns that same false/0 in SL, I don't think anyone would be checking the result, and certainly not aborting important steps that followed, or the script wouldn't work at all in SL.
So I think we can proceed with this one. Ready to merge.


Adding Black as precommit hook and applying it to existing code

Adding Black formatter
Updating Flake8 config to match with Black
Fixing Flake8 pre-commit hook to use wemake-python-styleguide plugin

Apart from comment above, I skimmed through the changes and looks good.


restrict settings view to general settings

Coverage decreased (-0.03%) to 88.31% when pulling 2beb4f981f42cc056b6a6ae2184a595a16953adb on fix/settings-view into e0d8c68f63ca90d39c9811221ed3cf474a89d0a2 on main.


Support ES7 async/await

This is supported (with experimental flag) in both Traceur and Babel. I can't use sweet right now because it throws when seeing async, await.

I'd like to see this resolved by somehow allowing anything as the output of a sweet.js macro.

I'd really like to see that as well.

We rely on esprima as our parser and AFAIK async/await hasn't been implemented in the esprima harmony branch yet (https://github.com/jquery/esprima/issues/1079).

So it's esprima and not escodegen that's the bottleneck?

Right, I think escodegen has support for async/await: https://github.com/estools/escodegen/issues/220.

How difficult would it be to switch esprima for acorn-babel?

I haven't tried but I suspect it's nontrivial. You'd need to make acorn work over syntax objects rather than the raw source because the parser has to accept the result of expansion (so the parser can do resolve at the appropriate places).
Really the right solution is not acorn or esprima. Sweet is already building up an AST (a TermTree in sweet jargon) in enforest which we then destruct back to a flat array after expansion is finished only to build another AST with esprima. We just need to get enforest to produce a robust enough TermTree that is Parser API compatible.

I'm mass closing issues due to the release of 1.0 obviating lots of bugs. If you feel this issue is something we still need to address feel free to reopen.


Reintroduce elasticsearch output

I spent some time reintroducing elasticsearch support.. next part would be to reintroduce file support and allow different types of input based on configuration.
I added the log crate for better logging (error!, debug!) and updated most crates within their semver.

I'm so sorry I overlooked you PR.  Thank you anyway!


iOS Lock Screen Controls Only Show Intermittently

I am using cordova-plugin-media and this plugin to play music and provide controls for users on the home screen for iOS. The below implementation is not entirely finished, but is at a point where it should work. My issue is that the controls only sometimes appear, other times nothing shows at all, and sometimes the controls show, but then disappear after a few minutes. Can anyone provide insight into how I can get the controls to always show, instead of randomly working some of the time after an app restart? It is the exact same code every times.
I have the background audio capability turned on inside my xcode project too.
`import AudioPlayerStore, { IAudioPlayerMetadata } from "../../../main/sharedStores/AudioPlayerStore";
import { IAudioPlayer } from "../interfaces/IAudioPlayer";
/** How often the duration is updated */
const TIMER_UPDATE: number = 1000;
declare var MusicControls: any;
/** The amount of time to skip forward and back */
const SKIP_DURATION_IN_SECONDS: number = 15;
export class CordovaAudioPlayer implements IAudioPlayer
{
// Varaibles
// =======================================
/** The instance of the cordova audio player */
private audioPlayer!: Media;

/** The reference to the timeout */
private updateTime: number = 0;

/** Whether or not the current audio is loading */
public isLoading: boolean = false;

/** The current time (in seconds) of the audio */
public currentTime: number = 0;

/** The total duration (in seconds) of the audio */
public duration: number = 0;

// Setup
// =======================================

constructor(public metaData: IAudioPlayerMetadata)
{
    this.audioPlayer = new Media(
        this.metaData.source,
        this.onPlayEnded.bind(this),
        this.onError.bind(this),
        this.statusChange.bind(this)
    );

    this.isLoading = true;
    this.play();
}

// Implements
// =======================================

/**
 * Play the audio
 */
public play(): void { this.audioPlayer.play(); }

/**
 * Pause the audio
 */
public pause(): void { this.audioPlayer.pause(); }

/**
 * Reset the player
 */
public reset(): void
{
    this.audioPlayer.stop();
    this.audioPlayer.release();
}

/**
 * Update the players current time
 *
 * @param time the new current time to set
 */
public setCurrentTime(time: number): void
{
    this.audioPlayer.seekTo(time * 1000);
    this.currentTime = time;

    MusicControls.updateElapsed({ elapsed: time });
}

private async statusChange(code: number): Promise<void>
{
    switch (code)
    {
        case Media.MEDIA_NONE:
            console.log("No media")
            break

        case Media.MEDIA_STARTING:
            console.log("Media starting");
            break

        case Media.MEDIA_RUNNING:
            console.log("Media running");

            this.duration = this.audioPlayer.getDuration();
            this.updateTime = setInterval(this.updateCurrentTime.bind(this), TIMER_UPDATE);
            this.updateCurrentTime();

            MusicControls.create({
                track: this.metaData.title,
                artist: this.metaData.author,
                hasSkipForward: true,
                hasSkipBackward: true,
                skipForwardInterval: 15,
                skipBackwardInterval: 15,
                duration: this.duration,
                elapsed: this.currentTime,
            }, () =>
            {
                console.log("Success but never gets called")
            }, this.onError.bind(this));

            MusicControls.subscribe(this.events.bind(this));
            MusicControls.listen();
            MusicControls.updateIsPlaying(true);

            AudioPlayerStore.instance.setIsPlaying(true);
            this.isLoading = false;

            break;

        case Media.MEDIA_PAUSED:
            clearInterval(this.updateTime);
            MusicControls.updateIsPlaying(false);
            AudioPlayerStore.instance.setIsPlaying(false);
            break;

        case Media.MEDIA_STOPPED:
            clearInterval(this.updateTime);
            this.isLoading = false;
            this.currentTime = 0;
            this.duration = 0;
            MusicControls.destroy();
            break;

        default:
            break;
    }
}

// Helpers
// =======================================

/**
 * Get the current players position wrapped in a promise
 */
private async getPlayerPosition(): Promise<number>
{
    return new Promise<number>((resolve, reject) =>
    {
        this.audioPlayer
            .getCurrentPosition((currentTime: number) => resolve(currentTime), (error: any) => reject(error))
    });
}

private onPlayEnded(): void { AudioPlayerStore.instance.setIsPlaying(false); }

private events(action: string): void
{
    const message = JSON.parse(action).message;
    switch (message)
    {
        case 'music-controls-skip-forward':
            const newForwardTime: number = Math.min(this.currentTime + SKIP_DURATION_IN_SECONDS, this.duration);
            this.setCurrentTime(newForwardTime);
            break;
        case 'music-controls-skip-backward':
            const newBackwardTime: number = Math.max(this.currentTime - SKIP_DURATION_IN_SECONDS, 0);
            this.setCurrentTime(newBackwardTime);
            break;
        case 'music-controls-pause':
            this.audioPlayer.pause();
            break;
        case 'music-controls-play':
            this.audioPlayer.play();
            break;
        case 'music-controls-destroy':
            // Do something
            break;

        // External controls (iOS only)
        case 'music-controls-toggle-play-pause':
            // Do something
            break;
        case 'music-controls-seek-to':
            const seekToInSeconds = JSON.parse(action).position;
            this.setCurrentTime(seekToInSeconds);
            break;

        default:
            break;
    }
}

private onError(err: any)
{
    console.log(err);
}

private async updateCurrentTime(): Promise<void>
{
    const elapsed: number = await this.getPlayerPosition();
    this.currentTime = elapsed;
    MusicControls.updateElapsed({ elapsed });
}

}
`

Turns out it was not working because of this config setting I had:

Turns out it was not working because of this config setting I had:

What are the right config settings please tell. Thanks


Keys are ordered randomly in line and table output formats

Due to the nature of the maps in golang, maps are iterated in random order.
At the same time, line and table output formats imply the columns order to be constant.

json format is a machine one, so it doesn't need to be strictly ordered.
log format depends on the logging mechanism. The current one, logrus, sorts keys in alphabetical order.


qmmp: 1.2.5 -> 1.3.1

Motivation for this change
cc @bjornfor
Things done

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

[x] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
[x] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Assured whether relevant documentation is up to date
[x] Fits CONTRIBUTING.md.

@bjornfor Thank you!


[WIP] System for detecting unused parameters

Addresses issue #2567 by displaying prominent warnings for unused parameters. The list of valid and invalid parameters are kept in static memory.
I would be quite hesitant to merge this right away -- let's test this for a while to make sure it doesn't break anything.

Codecov Report

Merging #2571 into master will increase coverage by 0.21%.
The diff coverage is 69.38%.

@@            Coverage Diff             @@
##           master    #2571      +/-   ##
==========================================
+ Coverage   35.13%   35.34%   +0.21%
==========================================
  Files          79       80       +1
  Lines        6971     7016      +45
  Branches      680      683       +3
==========================================
+ Hits         2449     2480      +31
- Misses       4421     4437      +16
+ Partials      101       99       -2

Impacted Files
Coverage Δ

src/tree/fast_hist_param.h
100% <ø> (ø)
:arrow_up:

src/objective/multiclass_obj.cc
16.41% <ø> (ø)
:arrow_up:

src/objective/regression_obj.cc
87.43% <ø> (+1.09%)
:arrow_up:

src/gbm/gblinear.cc
13.9% <ø> (ø)
:arrow_up:

include/xgboost/tree_model.h
7.51% <ø> (ø)
:arrow_up:

src/gbm/gbtree_model.h
27.58% <ø> (ø)
:arrow_up:

src/objective/rank_obj.cc
10.45% <ø> (ø)
:arrow_up:

include/xgboost/learner.h
88.23% <100%> (+88.23%)
:arrow_up:

src/tree/param.h
64.44% <100%> (ø)
:arrow_up:

src/gbm/gbtree.cc
19.53% <100%> (ø)
:arrow_up:

... and 7 more

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 03e213c...a9af106. Read the comment docs.

One thing that worries me is the use of static variables. I suspect the JVM test code creates multiple copies of Learner simultaneously, which would introduce data races with the tracking variables.

We can leave it for now. Perhaps there is another way of doing things other than static variables.
I think the interface can be frustrating for a lot of end users. In many cases it is possible to add parameters and have no idea if they are actually doing anything or not.
Internally parameters are also used as a kind of global state. For example the 'updater' parameter can be silently overwritten depending on what the 'tree_method' is set to.

@RAMitchell I will go ahead and close this PR for the time being. Let's think of a good parameter handling system that's more user friendly.


Fixing typo in name of "color"

Minor typo that's showing up in the docs reference page
@thierryk @renatoi

CLA is valid!

LGTM

Coverage remained the same at 100.0% when pulling acc2e844aea18b055a32124ccb72af195927d9cf on typo into 5d67f92c5a17f9c0f50a02346cc0b2b90e6ca409 on master.

Coverage remained the same at 100.0% when pulling acc2e844aea18b055a32124ccb72af195927d9cf on typo into 5d67f92c5a17f9c0f50a02346cc0b2b90e6ca409 on master.


Remove the 'Tools' section from the Merchants page

The Merchants page lists businesses and services that accept Monero in exchange for said services/products. The 'Tools' section is an exception, as it lists tools like block explorers, which accept Monero donations.
I think the merchants page is not the best place for these services. I suggest to remove the 'Tools' section from the merchants page and instead create a dedicated section somewhere else.

I might be missing something, but the 'Block Explorers' section is actually its own section outside of 'Tools,' right?
Regardless, I completely agree. Those types of things should be separated out from the 'Merchants' page.

Yes, my wording was incorrect. Both sections ("Tools" and "Block Explorers") should be moved somewhere elese.
Note we already have a "Monero Tools" user guide, which it's very ugly and should be replaced with something else. This could be a good moment to fix 2 problems at the same time.

which it's very ugly and should be replaced with something else.
For sure. Anything particular in mind as to what should replace it?

It seems more like a list of links rather than a 'guide,' which makes me think it should just be removed instead. And then maybe those links can be placed in the new 'Tools' section.

makes me think it should just be removed instead

I think so too, but before deleting it we need to come up with an alternative. We could have a dedicated "Tools" page under "Resources" and move the content of the guide and the two sections "Tools" and "Block Explorers"

Agreed :+1:
Can I take a try at this?

Sure go ahead. Would be good if you could share your progresses as you go, so we can look into this together. It will be a relatively big change.


[Icon request] Support for CMake files

Checklist:

[x] I'm sure this issue is not a duplicate?
[x] I want to create an icon request

From https://cmake.org/

CMake is an open-source, cross-platform family of tools designed to build, test and package software.

Both the full filename CMakeList.txt as well as the file extension *.cmake are used.
An icon can be found at https://openclipart.org/detail/214008/cmake
In this icon the colors have be reduced, which I think could help when it is being used as icon.

Already supported via extension. Look in Marketplace.

Just to make this clearer. We do support  .cmake already but we only show the icon when you have a CMake extension installed. That's the way icons and files are associated in certain cases. That allows us to only worry about the icon and not so much about the associations, which are provided by the CMake extension.

@robertohuertasm Thanks for clarifying this

@robertohuertasm I suppose it's prudent to add another section in README for what icons are supported via installed extensions.

I think so. This is a point that can lead to a lot of confusion. People expect their icons to work out of the box. That's a thing we already discussed. I can't stop thinking that we maybe should provide some associations even if they already have a language id association.


Get error on v1.0.1

res://addons/copilot/GithubCopilot.gd:167 - Invalid call. Nonexistent function 'has' in base 'Nil'.

on_request_completed get "bad request",and stuck the editor.

My bad. Seems i didn't follow the setup exectly

I get this error as well using github copilot. What was the resolution?
res://addons/copilot/GithubCopilot.gd:167 - Invalid call. Nonexistent function 'has' in base 'Nil'.


crowdsec plugin Memory Leak traefik 2.10.1

Welcome!

[X] Yes, I've searched similar issues on GitHub and didn't find any.
[X] Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you do?
I run the compose file below, I leave it for a few days and after and the memory consupmtion grows like 1 gb per day.
Is a personal/private site (1 user) so the traffic is extremely low.

What did you see instead?
I see a lot of ram comsupmtion
What version of Traefik are you using?

COMPOSE
COMPOSE
###############################################################
# Web Proxy DMZ
###############################################################

version: '3.9'

# Services ####################################################

services:

## Traefik ####################################################
  traefik:
    container_name: ProxyDMZ-Traefik
    image: traefik:latest
    restart: unless-stopped
    depends_on:
      - wpsocketproxy
      - crowdsec
    networks:
      wp-netsocketproxy:
      wp-netmodsecurity:
      wp-netredis:
      br2:
        ipv4_address: <IP_ADDRESS>
    dns: <IP_ADDRESS>
    ports:
      - 80:80
      - 443:443
      - 8080:8080 # Dashboard port
    volumes:
      - /mnt/user/Docker/WebProxyDMZ/Traefik:/etc/traefik/
    environment:
      - TZ
      - DOCKER_HOST=wpsocketproxy
      - CF_API_EMAIL_FILE
      - CF_DNS_API_TOKEN_FILE
    secrets:
      - CF_API_EMAIL
      - CF_DNS_API_TOKEN
    labels:
      - "traefik.enable=true"
      - "traefik.http.middlewares.localwhitelist2.ipwhitelist.sourcerange=<IP_ADDRESS>/24"
      - "traefik.http.routers.traefik-dashboard.middlewares=localwhitelist2"
      - "traefik.http.services.traefik-dashboard.loadbalancer.server.port=8080" #required
      - "traefik.http.routers.traefik-dashboard.rule=Host(`traefik.testsite.com.es`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
      - "traefik.http.routers.traefik-dashboard.tls=true"
      - "traefik.http.routers.traefik-dashboard.tls.certresolver=letsencrypt"
      - "traefik.http.routers.traefik-dashboard.service=api@internal" #required
      - "traefik.http.routers.api.service=api@internal" #required
      #- "traefik.http.routers.api.tls=true"
      #- "traefik.http.routers.traefik-dashboard.entrypoints=https443"
      - "com.centurylinklabs.watchtower.enable=true"

## Docker Socket Proxy ########################################
  wpsocketproxy:
    image: tecnativa/docker-socket-proxy
    container_name: ProxyDMZ-SocketProxy
    privileged: true
    restart: unless-stopped
    networks:
      - wp-netsocketproxy
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - LOG_LEVEL=notice # debug,info,notice,warning,err,crit,alert,emerg
      - CONTAINERS=1
      - POST=0
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

## DDNS Updater ###############################################
  ddns-updater:
    image: qmcgaw/ddns-updater
    container_name: ProxyDMZ-DDNSUpdater
    restart: unless-stopped
    networks:
      br1:
        ipv4_address: <IP_ADDRESS>
    ports:
      - 8002:8080/tcp
    volumes:
      - /mnt/user/Docker/WebProxyDMZ/DDNS-updater:/updater/data
    environment:
      - TZ
      #- CONFIG
      - PERIOD=5m
      - UPDATE_COOLDOWN_PERIOD=5m
      - PUBLICIP_FETCHERS=dns
      - PUBLICIP_HTTP_PROVIDERS=all
      - PUBLICIPV4_HTTP_PROVIDERS=all
      - PUBLICIPV6_HTTP_PROVIDERS=all
      - PUBLICIP_DNS_PROVIDERS=cloudflare
      - PUBLICIP_DNS_TIMEOUT=3s
      - HTTP_TIMEOUT=10s
      - LISTENING_PORT=8080
      - ROOT_URL=/
      - BACKUP_PERIOD=0 # 0 to disable
      - BACKUP_DIRECTORY=/updater/data
      - LOG_LEVEL=info
      - LOG_CALLER=hidden
      - SHOUTRRR_ADDRESSES_FILE
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

## ModSecurity Core Rule Set (CRS) ############################
# https://blog.xentoo.info/2022/01/22/traefik-reverse-proxy-with-modsecurity/
  modsecurity:
    image: owasp/modsecurity-crs:apache-alpine
    container_name: ProxyDMZ-ModSecurity
    restart: unless-stopped
    networks:
      - wp-netmodsecurity
    volumes:
      - /mnt/user/Docker/WebProxyDMZ/ModSecurity/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf:/etc/modsecurity.d/owasp-crs/rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf
      - /mnt/user/Docker/WebProxyDMZ/ModSecurity/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf:/etc/modsecurity.d/owasp-crs/rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf
      - /mnt/user/Docker/WebProxyDMZ/ModSecurity/crs-setup.conf:/etc/modsecurity.d/owasp-crs/crs-setup.conf
      #- /mnt/user/Docker/WebProxyDMZ/ModSecurity:/etc/modsecurity.d/owasp-crs/rules
      #- /mnt/user/Docker/WebProxyDMZ/ModSecurity/auditlogs:/dev/stdout
      #- /mnt/user/Docker/WebProxyDMZ/ModSecurity/data:/tmp/modsecurity/data
    environment:
      # ModSecurity ENV Variables
      # CRS specific variables
      - MANUAL_MODE=1
      #- PARANOIA=1
      #- ANOMALY_INBOUND=6
      #- ANOMALY_OUTBOUND=5
      - BACKEND=http://dummy

  dummy:
    image: traefik/whoami
    container_name: ProxyDMZ-ModSecurity-Dummy
    restart: unless-stopped
    networks:
      - wp-netmodsecurity

## CrowdSec ###################################################

  crowdsec:
    image: crowdsecurity/crowdsec
    container_name: ProxyDMZ-CrowdSec
    restart: unless-stopped
    networks:
      br2:
        ipv4_address: <IP_ADDRESS>
    dns: <IP_ADDRESS>
    ports:
      - 8080:8080
     #- 6060:6060 # PROMETEUS
    volumes:
      - /mnt/user/Docker/WebProxyDMZ/CrowdSec/data:/var/lib/crowdsec/data
      - /mnt/user/Docker/WebProxyDMZ/CrowdSec:/etc/crowdsec
      - /mnt/user/Docker/WebProxyDMZ/Traefik/logs:/var/log/traefik:ro
      - /mnt/user/Docker/HomeAssistant:/var/log/homeassistant:ro
    environment:
      TZ:
      COLLECTIONS: "crowdsecurity/traefik crowdsecurity/home-assistant crowdsecurity/http-cve crowdsecurity/whitelist-good-actors"
      #GID: "${GID-1000}"
      PUID:
      PGID:
      CUSTOM_HOSTNAME: CrowdSecDMZ
      DISABLE_LOCAL_API: "false" # True Only after successfully registering and validating remote agent below.
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

## CrowdSec - Redis ###########################################

  redis-cs:
    image: redis:alpine
    container_name: ProxyDMZ-CrowdSec-Redis
    restart: unless-stopped
    depends_on:
      - crowdsec
    command: [ "sh", "-c", "exec redis-server --requirepass $REDIS_PASSWORD" ]  # redis-cli -a "password" --stat # select 1 # dbsize
    networks:
      - wp-netredis
    dns: <IP_ADDRESS>
    volumes:
      - /mnt/user/Docker/Nextcloud/redis:/data
    environment:
      - TZ
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

# ## CrowdSec - Cloudflare Bouncer ##############################

# # Set max ip number right the first time (max 10000). Recreating the container deletes all ips and readds them causing cloudflare 429 rate limiting.
#   cloudflare-bouncer:
#     image: crowdsecurity/cloudflare-bouncer
#     container_name: WebProxyDMZ-CrowdSec-Cloudflare
#     restart: unless-stopped
#     depends_on:
#       - crowdsec
#     networks:
#       br2:
#         ipv4_address: <IP_ADDRESS>
#     dns: <IP_ADDRESS>
#     environment:
#       - TZ
#     volumes:
#       - /mnt/user/Docker/WebProxyDMZ/CrowdSec/cloudflare-bouncer/cfg.yaml:/etc/crowdsec/bouncers/crowdsec-cloudflare-bouncer.yaml
#       - /mnt/user/Docker/WebProxyDMZ/CrowdSec/cloudflare-bouncer/cache:/var/lib/crowdsec/crowdsec-cloudflare-bouncer/cache

# Networks ####################################################

networks:
  br2:
    driver: macvlan
    external: true
  br1:
    driver: macvlan
    external: true
  wp-netsocketproxy:
    internal: true
  wp-netredis:
    internal: true
  wp-netmodsecurity:
    internal: true

# Secrets #####################################################

secrets:
  # Traefik - CF_API_EMAIL
  CF_API_EMAIL:
    file: $SECRETSDIR/CF_API_EMAIL
  # Traefik - CF_API_EMAIL
  CF_DNS_API_TOKEN:
    file: $SECRETSDIR/CF_DNS_API_TOKEN

traefik.yml
global:
  checkNewVersion: true
  sendAnonymousUsage: false

serversTransport:
  insecureSkipVerify: true # allow insecure backend connections

entryPoints: # Not used in apps, but redirect everything from HTTP to HTTPS

  http80:
    address: :80
    http:
      redirections:
        entryPoint:
          to: https443
          scheme: https
          permanent: true

  # HTTPS endpoint, with domain wildcard
  https443:
    address: :443
    #forwardedHeaders:
    #  trustedIPs: *trustedIps # Reuse list of Cloudflare Trusted IP's above for HTTPS requests
    http:
      tls:
        certResolver: letsencrypt
        domains:
          - main: testsite.com.es
            sans:
              - '*.testsite.com.es'
      middlewares:
        - securityHeaders@file

providers:
  providersThrottleDuration: 15s
  file:
    filename: /etc/traefik/fileConfig.yml
    watch: true

  # Docker provider for connecting all apps that are inside of the docker network
  docker:
    watch: true
    network: br2 # Add Your Docker Network Name Here
    # Default host rule to containername.domain.example
    defaultRule: "Host(`{{ index .Labels \"com.docker.compose.service\"}}.testsite.com.es`)"
    swarmModeRefreshSeconds: 15s
    exposedByDefault: false
    endpoint: "tcp://wpsocketproxy:2375"

# Enable traefik ui
api:
  dashboard: true
  insecure: false

# Log level INFO|DEBUG|ERROR
log:
  level: INFO # (Default: error) DEBUG, INFO, WARN, ERROR, FATAL, PANIC
  filePath: "/etc/traefik/logs/traefik.log"
accesslog:
  filePath: "/etc/traefik/logs/access.log"
  bufferingSize: 100
  filters:
    statusCodes:
      - "200-299"
      - "400-499"
      - "500-599"

# Use letsencrypt to generate ssl serficiates
certificatesResolvers:
  letsencrypt:
    acme:
      email<EMAIL_ADDRESS>      storage: /etc/traefik/acme.json
      dnsChallenge:
        provider: cloudflare
        # Used to make sure the dns challenge is propagated to the rights dns servers
        resolvers:
          - "<IP_ADDRESS>:53"
          - "<IP_ADDRESS>:53"
        delayBeforeCheck: 90

# Traefik plugins
experimental:
  plugins:
    crowdsec-bouncer-traefik-plugin:
      moduleName: "github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin"
      version: "v1.1.12"

    traefik-modsecurity-plugin:
      moduleName: "github.com/acouvreur/traefik-modsecurity-plugin"
      version: "v1.3.0"

fileconfig.yml
http:

# Home Assistant
  routers:

    homeassistant:
      entryPoints:
        - https443
      rule: 'Host(`ha.testsite.com.es`)'
      service: homeassistant
      middlewares:
        - traefik-csbouncer
        - traefik-modsecurity
        - rate-limit

    plex:
      entryPoints:
        - https443
      rule: 'Host(`plex.testsite.com.es`)'
      service: plex
      middlewares:
        #- traefik-csbouncer
        - traefik-modsecurity

  services:

    homeassistant:
      loadBalancer:
        servers:
          - url: http://<IP_ADDRESS>:8123/

    plex:
      loadBalancer:
       servers:
          - url: http://<IP_ADDRESS>:32400/

  ## MIDDLEWARES ##
  middlewares:

    # Only Allow Local networks
    local-ipwhitelist:
      ipWhiteList:
        sourceRange:
          - <IP_ADDRESS>/24 # localhost

    # Rate limit
    rate-limit:
      rateLimit:
        average: 200
        burst: 100

    # Crowdsec bouncer
    traefik-csbouncer:
      plugin:
        crowdsec-bouncer-traefik-plugin:
          enabled: true
          logLevel: INFO
          updateIntervalSeconds: 30 # stream mode only
          #defaultDecisionSeconds: 60 # live mode only
          crowdsecMode: stream
          crowdsecLapiKey: b2e210d71f34de53c8fe68d4f970e060 # Api key for 'traefik'
          crowdsecLapiHost: <IP_ADDRESS>:8080
          crowdsecLapiScheme: http
          crowdsecLapiTLSInsecureVerify: false
          #forwardedHeadersTrustedIPs:   # List of IPs of trusted Proxies that are in front of traefik (ex: Cloudflare)
          clientTrustedIPs:
            - <IP_ADDRESS>/24
          forwardedHeadersCustomName: X-Forwarded-For
          redisCacheEnabled: true
          redisCacheHost: redis-cs:6379
          redisCachePassword: 3QVMvJWExUVKDGtbU8ucJKacBCBLH3rP
          redisCacheDatabase: 1

    traefik-modsecurity:
      plugin:
        traefik-modsecurity-plugin:
          #MaxBodySize: "52428800"
          ModsecurityUrl: http://modsecurity:80
          TimeoutMillis: "2000"

    # Enable gzip compression
    test-compress:
      compress: {}

    # Security headers
    securityHeaders:
      headers:
        customResponseHeaders:
          X-Robots-Tag: "none,noarchive,nosnippet,notranslate,noimageindex"
          server: ""
          X-Forwarded-Proto: "https"
        sslProxyHeaders:
          X-Forwarded-Proto: "https"
        referrerPolicy: "strict-origin-when-cross-origin"
        hostsProxyHeaders:
          - "X-Forwarded-Host"
        customRequestHeaders:
          X-Forwarded-Proto: "https"
        framedeny: true # Set frameDeny to true to add the X-Frame-Options header with the value of DENY.
        contentTypeNosniff: true # Set contentTypeNosniff to true to add the X-Content-Type-Options header with the value nosniff.
        browserXssFilter: true
        forceSTSHeader: true
        stsIncludeSubdomains: true
        stsSeconds: 63072000
        stsPreload: true
        permissionsPolicy: "geolocation=(self), interest-cohort=(), camera=(), microphone=(), payment=(), usb=(), vr=(), web-share=()"

        #contentSecurityPolicy: "report-uri csp:8080, default-src 'self'"
        # default-src 'self';
        # script-src 'report-sample' 'self';
        # style-src 'report-sample' 'self';
        # object-src 'none';
        # base-uri 'self';
        # connect-src 'self';
        # font-src 'self';
        # frame-src 'self';
        # img-src 'self';
        # manifest-src 'self';
        # media-src 'self';
        # report-uri https://64771d916de1519cde13ca45.endpoint.csper.io/?v=0;
        # worker-src 'none';

        # accessControlAllowMethods:
        #   - GET
        #   - OPTIONS
        #   - PUT
        # accessControlMaxAge: 100

# Only use secure ciphers - https://ssl-config.mozilla.org/#server=traefik&version=2.6.0&config=intermediate&guideline=5.6
tls:
  options:
    default:
      minVersion: VersionTLS12
      cipherSuites:
        - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384   # TLS 1.2
        - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305    # TLS 1.2
        - TLS_AES_256_GCM_SHA384                  # TLS 1.3
        - TLS_CHACHA20_POLY1305_SHA256            # TLS 1.3
        - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
        - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305
      curvePreferences:
        - CurveP521
        - CurveP384
      sniStrict: true

If applicable, please paste the log output in DEBUG level
No response

We see the same behaviour. with 2.10.1 on 2.9.4 there was no issues with sam settings.
We use Traefik as Kubernetes ingress controller.

Can you check with docker stats --all --no-stream --no-trunc or
docker stats --no-stream --format "table {{.Name}}\t{{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}" | sort -k 4 -h

We had a discussion about memory before where it was probably only the wrong metric in Grafana.
We are running traefik:v2.10.1 in Docker Swarm on Debian, there it seems to be stable.

Thanks for the response.
We use containers on GKE and retrieving metrics not thru Grafana.
We do not have "ctr -n k8s.io containers stats" available. But I can check any other parameters.
Here is a screenshot how all look like:

Can you check with docker stats --all --no-stream --no-trunc or
docker stats --no-stream --format "table {{.Name}}\t{{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}" | sort -k 4 -h

We had a discussion about memory before where it was probably only the wrong metric in Grafana.
We are running traefik:v2.10.1 in Docker Swarm on Debian, there it seems to be stable.

I have restarted the container again, this is like the 3rd time I have to do it due to high RAM consumption so now the situation is ok.

The only thing I have done different this time is to disable the crowdsec bouncer just to discard it from the equation, if it happens again I will do the same with modsecurity.

I think I found the problem,
As soon as I enable the crowdsec plugin/middleware in the config traefik start to consume more ram

Hello @lordraiden,
After discussing this issue with the team, at first glance we think too that the memory consumption is due to the crowdsec plugin.
We keep this issue open until you provide feedback about the memory usage.

https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/issues/104
It looks like a fix is going to be release to fix this.
Since yesterday the memory consumption has rise to 2 gb

Hey @lordraiden,
Thanks for this feedback.
As the issue was on the plugin side, I close this one.


Support hashable-1.4?

Currently, the bounds for hashable look like this: hashable (>=1.2 && <1.4). But hashable-1.4 already has two minor versions. Maybe the upper bound can be raised to include them?

This broke the downstream project CI:
[__2] skipping: hashable-<IP_ADDRESS>, hashable-<IP_ADDRESS> (has the same
characteristics that caused the previous version to fail: excluded by
constraint '>=1.2 && <1.4' from 'relude')
[__2] trying: hashable-<IP_ADDRESS>
[__3] next goal: base (dependency of hnix)
[__3] rejecting: base-<IP_ADDRESS>/installed-<IP_ADDRESS> (conflict: hashable =>
ghc-bignum>=1.0 && <1.1 || >=1.2 && <1.3, base =>
ghc-bignum==1.1/installed-1.1)

And the v2-freeze or v2-test do not allow --allow-newer to circumvent this.
To solve this downstream the downstream project/CI workflows would need to be redesigned to have .project to freeze on some Hackage index-state to circumvent this & pretend to live in the old Hackage state & that would mean to update index-state all the time on any update.

Upload of ghc-bignum 1.1 was requested at https://gitlab.haskell.org/ghc/ghc/-/issues/19632#note_400751.

Several things happened in upstream packages to solve this, seems like upstream things should be resolved now.
relude can upgrade to new hashable.


Access Denied to Database

I have attempted to setup Lychee on a Debian 8 machine with Nginx.
Upon loading the web interface I entered a simple username and password into the required fields, and click connect.  Then I am greeted with this screen http://i.snag.gy/TQKhF.jpg
I have all the required PHP modules loaded, and MYSQL installed on the machine.

What does the diagnostics say (Settings>Diagnostics)?

Sorry, I thought I included that.
It says:
Error 001: Configuration not found. Please install Lychee first.

Please try again with the newest version of Lychee (v3) and send me the new diagnostics (including the system information).

Can't reproduce.


Implement @ObservableDefault macro

Hi there! Thought I'd pitch in and contribute to this great package. This addresses #142 by creating a new macro that can be used inside @Observable classes.
The macro is implemented in a new DefaultsMacros module. The decision to do so is based on the introduction of a new dependency on swift-syntax, and to keep the main module dependency-free (specially since the syntax package adds quite a bit to build times). Please, let me know if you'd rather move it to the main module.
Settings the PR as draft for early review, but there are at least a couple things I want to do to get it ready. Also, I haven't put much thought into the naming; advice on this is appreciated.
TODO

[X] Figure out if @ObservationIgnored can be added automatically as part of the macro.

This is not possible. There's currently no way for a macro attached to a property to add attributes to that same property.

[X] Add more test cases.
[x] Add docstring to the macro declaration.
[X] Add info on how to use the macro to the README.

Thanks for working on this 🙏

The decision to do so is based on the introduction of a new dependency on swift-syntax, and to keep the main module dependency-free (specially since the syntax package adds quite a bit to build times).

👍

I think this is now ready for review. Please, let me know about any issues/concerns.
BTW I renamed the macro to @Default so it is familiar. Let me know what you thing about this!

I don't think the @Default naming is going to work. The moment you import DefaultsMacros in a place that uses the @Default property wrapper, those become macro usages too, which doesn't work in a View. I guess we can name it ObservableDefault.

The macro is also missing an important feature; it does not trigger updates to the model if a Defaults key is changed outside of the model. For example, if you set Defaults[.foo] = true somewhere in your code, the model will not be triggered. I think the user would expect the model to always be in sync with Defaults.

Thank you for fixing the typos.

I don't think the @Default naming is going to work. The moment you import DefaultsMacros in a place that uses the @Default property wrapper, those become macro usages too, which doesn't work in a View. I guess we can name it ObservableDefault.

Ah, this makes sense in hindsight. Will rename 👍🏽

The macro is also missing an important feature; it does not trigger updates to the model if a Defaults key is changed outside of the model. For example, if you set Defaults[.foo] = true somewhere in your code, the model will not be triggered. I think the user would expect the model to always be in sync with Defaults.

Yeah, this is indeed an important shortcoming. I've been fiddling to see if I could come up with something that is easy to use and works well. This is what I arrived at (expanded version), let me know what you think @sindresorhus:
@Observable
final class TestModelWithoutMacro {
	@ObservationIgnored
	var testValue: String {
		get {
			_ = _testValueObserver                // <--- Make sure the lazy var is initialized

			access(keyPath: \.testValue)
			return Defaults[keyProperty]
		}
		set {
			withMutation(keyPath: \.testValue) {
				Defaults[keyProperty] = newValue
			}
		}
	}

	// Use a lazy var so we can access self
	@ObservationIgnored
	private lazy var _testValueObserver: Defaults.Observation =
		Defaults.observe(.test) { keyChange in
			self.testValue = keyChange.newValue
		}

Yeah, that looks good.
Should be Defaults.observe(Defaults.Keys.test, options: []) { keyChange in so it doesn't trigger an initial update.

OK... I'm a bit confused. When typing out the observation property, since it is lazy Swift doesn't complain about capturing self. However, when it's added via macro expansion it does?
I need to investigate why this happens... Any ideas?

Not sure.

 Xcode eats the error, but I can see it when using swift test in a terminal.
Will ask there and try to come up with other alternatives in the meantime.

While there's been no activity about the lazy properties in macros, I do have something else to comment on the PR.
I was fiddling around with other alternatives, and an issue came up that also applies when using the lazy property: if the @Observable class is marked as Sendable, lazy properties cause a warning in Swift 5 and an error in Swift 6 due to their inherent mutability. Basically, this means that any solution that involves a var will cause warnings and/or errors.
Will keep thinking about other ways, but I'm no longer sure it's possible to do with the current macro capabilities. I may be missing some clever trick to it.

Basically, this means that any solution that involves a var will cause warnings and/or errors.

Use a lock and mark the variable with @unchecked Sendable.

Use a lock and mark the variable with @unchecked Sendable.

Thank you for the suggestion, a lock may work. But did you mean to mark the @Observable class with @unchecked Sendable? Not sure there is a way to just mark one property.
We could generate the code below and warn users that if they need the model to be Sendable they need to either use @unchecked or mark it @MainActor, either would work. However, I'm worried that suggesting marking it as @unchecked may hide other possible errors and people complain about it. Do you think adding a warning in the README is a good enough mitigation?
/* This source generates the model below.

@Observable
final class TestModel: @unchecked Sendable {
	@ObservableDefault(Defaults.Keys.test)
	@ObservationIgnored
	var testValue: String
}
*/
@Observable
final class TestModel: @unchecked Sendable {
	@ObservationIgnored
	var testValue: String {
		get {
			// Ensure the observation is set up, using the lock to prevent data races
			_testValueLock.lock()
			_ = _testValueObservation
			_testValueLock.unlock()

			access(keyPath: \.testValue)
			return Defaults[Defaults.Keys.test]
		}
		set {
			withMutation(keyPath: \.testValue) {
				Defaults[Defaults.Keys.test] = newValue
			}
		}
	}

	@ObservationIgnored
	private let _testValueLock: Lock = .make()
	@ObservationIgnored
	private lazy var _testValueObservation: Defaults.Observation? = {
		Defaults.observe(Defaults.Keys.test, options: []) { [weak self] keyChange in
			self?.testValue = keyChange.newValue
		}
	}()
}

I was thinking there was a keyword for ignoring sendable, but what I meant was wrap it in an unchecked sendable box:
final class LockedSendableValue<Value>: @unchecked Sendable {
	private var _value: Value
	private let lock = Lock()

	init(_ value: @autoclosure @Sendable () throws -> Value) rethrows {
		self._value = try value()
	}

	func withValue<T: Sendable>(
		_ operation: @Sendable (inout Value) throws -> T
	) rethrows -> T {
		try self.lock.withLock {
			var value = self._value
			defer { self._value = value }
			return try operation(&value)
		}
	}
}

But did you mean to mark the @Observable class with @unchecked Sendable? Not sure there is a way to just mark one property.

No

How about something like this? This also correctly destroys the event subscription when the class deinits:
extension Defaults.Keys {
	static let test = Key<String>("test", default: "")
}

@Observable
final class TestModelWithoutMacro {
	private enum AssociatedKeys {
		static var observer = 1
	}

	@ObservationIgnored
	var testValue: String {
		get {
			if objc_getAssociatedObject(self, &AssociatedKeys.observer) == nil {
				let cancellable = Defaults.publisher(.test)
					.sink { [weak self] in
						self?.testValue = $0.newValue
					}
				objc_setAssociatedObject(self, &AssociatedKeys.observer, cancellable, .OBJC_ASSOCIATION_RETAIN)
			}

			access(keyPath: \.testValue)
			return Defaults[.test]
		}
		set {
			withMutation(keyPath: \.testValue) {
				Defaults[.test] = newValue
			}
		}
	}
}

Friendly bump in case you forgot about this :)

@sindresorhus I spent some time (not a lot) and it seems like using the associated objects may work, so I'm trying to put that together.
I need to figure out a way to generate unique keys for each property so they don't collide, but after that it should be looking good.

Seems like you can just defined the keys as Void?, so I made the macro add a private property like such per needed key.
Thank you so much for the help with that! Let me know what you think of this!

This works great! Tested it in a real app. Nice work.

Only one problem left. When enabling Swift 6 mode, I get a warning:

/var/folders/ng/1dc3svp96z36746xz4czb25r0000gn/T/swift-generated-sources/@_swiftmacro_5Plash8CatModelC7catName17ObservableDefaultfMp.swift:1:20 Static property '_objcAssociatedKey_catName' is not concurrency-safe because it is nonisolated global shared mutable state

@kevinrpb This looks good from my side. Maybe you want to take a last look over and approve this before I merge?

@sindresorhus thank you for pushing the change.
I tested it in my own app and it all seems to be working properly, so unless you have anything else you'd like me to change, I figure it's ready for the merge.
Thank you once again for taking the time to look through all of it!

Thanks for contributing 🙏

https://github.com/sindresorhus/Defaults/releases/tag/9.0.0


#1967: Fix asymmetry in rs2::event_information

Addresses #1967:

Add proposed implementation for symmetric interfaces
Update python bindings to reflect symmetric interface

@aangerma @lramati - Do you remember why it was done this way in the first place?

Ok, after talking to the team:

was_added - this makes sense to add, however, originally such query didn't make sense to us, since if the device wasn't connected before, how would the user know to query if it was added?
get_removed_devices - the main question, assuming we return a device_list is what the user can actually do with it? Trying to create (== access via [] operator) any device in that list will fail (because it is no longer present), so the only thing you could do on that list is to compare against some prior known info, which is what was_removed is doing.

@dorodnic , FWIW, the get_removed_devices scenario is the one that I first wanted. It came up in the context of building a Gtk application around librealsense. In my application, I've had to build a fairly complicated set of proxies for librealsense objects that make it possible to "bounce" librealsense events into the Gtk event system via a "trampoline" (Wikipedia has a good description of this "trampoline" design approach here: https://en.wikipedia.org/wiki/Trampoline_(computing) under the section on incompatible calling conventions). The trampoline is required because using callbacks supplied to sensor::start causes events to be delivered from threads hidden inside librealsense, thus necessitating the use of mechanisms like GObject.idle_add to provide deferred, asynchronous delivery of librealsense events into Gtk.
In my approach to implementing the trampoline, I wanted to be aware that it is better to generate lots of small, quickly handled events than few complicated events from a Gtk/Glib perspective -- it preserves the sense of interactivity and keeps everything nicely responsive / "snappy". As a result, rather than broadcasting the notification directly, I want instead to directly broadcast proxies of the cameras which have been added and the cameras which had been removed, thereby allowing subscribers to figure out what they wanted to do without needing the rest of the details about the event. This is how I found the asymmetry in the first place.
My application is an example of your use case 1 --- I do things like enumerate all available RS devices, query / manipulate a single RS device, and then issue individual device resets as part of my normal working with a D415 or D435. I then wait for the events indicating those devices have finished their reset and are, once again, available.

@BrendanDrew thanks for the explanation. We will merge this into this weeks release. I just wanted to share the reasoning behind the original API.
Reopening the PR to dev branch to re-trigger CI.


[Spike] Cleanup use-assets

Summary

Use correct ethers.parseUnits function to parse amount in transfer example
Remove examples of functions that aren't for the public

Checklist

[x] Add description

Summary

Use correct ethers.parseUnits function to parse amount in transfer example
Remove examples of functions that aren't for the public

Checklist

[x]  Add description

why we don't want creating asset to be open for public..
Although user can go to portal and create asset

Summary

Use correct ethers.parseUnits function to parse amount in transfer example
Remove examples of functions that aren't for the public

Checklist

[x]   Add description

why we don't want creating asset to be open for public.. Although user can go to portal and create asset

I don't think user can go to portal and create asset, attempting to fails with this error
Error: Extrinsic sending failed, [system.CallFiltered] The origin filter prevent the call to be dispatched.


How to update runtime for previously deployed env running on Nodejs 12.x

What is your question?

AWS support contacted us, informing that Nodejs 12.x runtime is going to be end of support. But change the runtime to Nodejs 14.x on the console dit not work. Do we have some kind of advice on handling this?

We are in the same boat. The guide mentions to uninstall your current instance first. Uninstalling an instance of this running in production is not possible for us. A guide that details how to upgrade and having zero downtime would be helpful.

Same Issue with us, will not stop production please advice.  :-)

There are a few options I can see depending on how you've got this implemented.

Spin up a new stack while keeping your current production one active, if you are using DNS update your CNAME or A record Alias (If using Route53) to point to the new Cloudfront endpoint.

If you are not using DNS then spin up a new stack using the most recent version and change all references of the Cloudfront URL to the new one in your production app.

Clone the repo (I.E 5.2.0) update the dependencies to a version where the base CDK added node14 or 16 support , making sure you check if there are any breaking changes mentioned. Follow the instructions in the Readme and then create a change set for your current stack in CloudFormation. Before doing this on production i'd update a test environment first if going this route.

There are a few options I can see depending on how you've got this implemented.

Spin up a new stack while keeping your current production one active, if you are using DNS update your CNAME or A record Alias (If using Route53) to point to the new Cloudfront endpoint.
If you are not using DNS then spin up a new stack using the most recent version and change all references of the Cloudfront URL to the new one in your production app.
Clone the repo (I.E 5.2.0) update the dependencies to a version where the base CDK added node14 or 16 support , making sure you check if there are any breaking changes mentioned. Follow the instructions in the Readme and then create a change set for your current stack in CloudFormation. Before doing this on production i'd update a test environment first if going this route.

Hi Thanks,
can you set up a new stack next to 5.2
On this web page I read this
https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/welcome.html
Note
You cannot update earlier versions of the Serverless Image Handler solution to version 6.0.0 due to changes with how resources are deployed to your environment. To use version 6.0.0, you must uninstall the previous version of the solution first, and then launch a new stack using version 6.0.0 of the AWS CloudFormation template.
For me it seems like we need to uninstall first..
B

There are a few options I can see depending on how you've got this implemented.

Spin up a new stack while keeping your current production one active, if you are using DNS update your CNAME or A record Alias (If using Route53) to point to the new Cloudfront endpoint.
If you are not using DNS then spin up a new stack using the most recent version and change all references of the Cloudfront URL to the new one in your production app.
Clone the repo (I.E 5.2.0) update the dependencies to a version where the base CDK added node14 or 16 support , making sure you check if there are any breaking changes mentioned. Follow the instructions in the Readme and then create a change set for your current stack in CloudFormation. Before doing this on production i'd update a test environment first if going this route.

Hi Thanks, can you set up a new stack next to 5.2
On this web page I read this https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/welcome.html
Note You cannot update earlier versions of the Serverless Image Handler solution to version 6.0.0 due to changes with how resources are deployed to your environment. To use version 6.0.0, you must uninstall the previous version of the solution first, and then launch a new stack using version 6.0.0 of the AWS CloudFormation template.
For me it seems like we need to uninstall first..
B

No you don't need to uninstall first.
You'd create a new stack using the 6.0.0 template which will create all new independent resources such as a new Cloudfront endpoint, Api gateway , Lambdas ETC while keeping your 5.2.0 version running.
Once you are happy it's working in the same way and you've made the changes to your app to point to the new Cloudfront endpoint (or update your DNS) then you can uninstall the old stack.
Currently i've got a 5.2.0 & 6.0.0 stack running and looking at the same S3 source bucket

There are a few options I can see depending on how you've got this implemented.

Spin up a new stack while keeping your current production one active, if you are using DNS update your CNAME or A record Alias (If using Route53) to point to the new Cloudfront endpoint.
If you are not using DNS then spin up a new stack using the most recent version and change all references of the Cloudfront URL to the new one in your production app.
Clone the repo (I.E 5.2.0) update the dependencies to a version where the base CDK added node14 or 16 support , making sure you check if there are any breaking changes mentioned. Follow the instructions in the Readme and then create a change set for your current stack in CloudFormation. Before doing this on production i'd update a test environment first if going this route.

Hi Thanks, can you set up a new stack next to 5.2
On this web page I read this https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/welcome.html
Note You cannot update earlier versions of the Serverless Image Handler solution to version 6.0.0 due to changes with how resources are deployed to your environment. To use version 6.0.0, you must uninstall the previous version of the solution first, and then launch a new stack using version 6.0.0 of the AWS CloudFormation template.
For me it seems like we need to uninstall first..
B

No you don't need to uninstall first.
You'd create a new stack using the 6.0.0 template which will create all new independent resources such as a new Cloudfront endpoint, Api gateway , Lambdas ETC while keeping your 5.2.0 version running.
Once you are happy it's working in the same way and you've made the changes to your app to point to the new Cloudfront endpoint (or update your DNS) then you can uninstall the old stack.
Currently i've got a 5.2.0 & 6.0.0 stack running and looking at the same S3 source bucket

Thanks a lot I will give it a try.
B

Seems to work fine, have now two installation with two endpoints
image52.mydomain.xx
image60.mydomain.xx
When all is moved to image60.mydomain.xx  I will delete the others.

Thank you for the observation, we will add updating the documentation to include an approach for updating the solution without downtime.


Update portal data model to associate all obs columns with an organism

Currently, only development_stage has an ontology that is specific to the organism. (And ethnicity is a NA for Mus Musculus).
In part to support multi-organism datasets, all obs fields should have some form of relation to an organism type.
The expectation is that a filter by tissue should result in results specific to the organism related to said tissue and not any other organism(s) present in the dataset containing the filtered tissue:

The Homo sapiens data includes diseaseA and tissueA. The Mus musculus data includes diseaseB and tissueB. This is displayed in the cellxgene data portal as a dataset with columns:
Organism
Homo sapiens
Mus musculus
Tissue
tissueA
tissueB
Disease
diseaseA
diseaseB
If a data consumer filters for Homo sapiens AND disease B, this dataset should not match. If a data consumer filters for Mus musculus AND tissueA, this dataset should not match.

Closing per July 27 Refinement: We agreed to continue to model organism as a dataset property rather than a observation property which may return false positives during search and filter. @maniarathi to provide a schedule for a re-design of the data model to support indexing of observations to enable accurate search+filter and dataset fabrication where a consumer requests the fabrication of a new dataset consisting of slices from one or more datasets that met the search+filter criteria.


Rendering glitching (memory leak?)

Godot version
4.0.2 stable
System information
Windows 10, Forward+, 1060GTX, latest nvidia driver ver 531.68
Issue description
I have been having rendering related full screen glitches lately while running any Godot 4.x projects. Both for my projects and others in the editor and in exported games. Eventually the editor itself started glitching. I didn't leave my Godot projects open so I'm guessing that means that the memory leak continues between sessions. I restarted my pc and it stopped happening.
Its worth noting I don't close my computer often so that's why I think it got progressively worse, and why I think its a memory leak. I also tried updating my nvidia driver from the previous one that was around 8 months old to the most recent one, with no changes really.
This also didn't happen every time i started a godot project, at the beginning it was only about half the time.
Might be related to #75613 .
Picture related:

Pictures from TestSubject06#4319 on discord having a similar issue, on OS level:

Steps to reproduce
Maybe let your computer run for a few days, open and close Godot a bunch of times and wait for something to start happening? :D
Minimal reproduction project
N/A

I didn't leave my Godot projects open so I'm guessing that means that the memory leak continues between sessions. I restarted my pc and it stopped happening.

That shouldn't possibly happen, as a terminated process always has all of its memory reclaimed (both system RAM and VRAM). As far as I know, Vulkan doesn't require manual cleanup here.

I also have a GTX1060, and I ran into this exact same issue, with precisely the same visual glitches you showed. For me it occured after setting the volume_depth of volumetric fog in the project settings to 512 in an alpha build of godot 4. Even after restarting my PC the issue persisted. However for me, the issue vanished after reinstalling my GPU drivers. I was even able to set my volume depth to 512 without running into the issue again. I assumed it was just a driver issue but perhaps it is specific to the 1060.


add pSilent aim and fix crit hack

weapons that can use pSilent, use pSilent, bullet weapon no able use pSilent, so it no use pSilent.
add ur own crithack.


OperatorsSpacesFixer - Do not unalign double arrow and equals operators

fixes the last N reported issues

I would put normalizing spaces around = and =>as option instead of removing it, false by default.
Then, on master true by default, and remove that unalign_=/=> fixers.

fixes the last N reported issues

which one? so after this we will know what to close ;)

Info:
I have changed the target branch, 1.11 is not supported anymore.

:+1:

Thank you @SpacePossum.

merged into 2.x, @SpacePossum please do the needful

nice, thanks! I'll start working on a master version:)


Added Averages Calculator #463

Issue Id you have worked upon -
I have worked on task #463 and added an averages calculator.
Fixes #463
Briefly explain your program logic -
It allows users to input a comma-separated list of numbers. Upon clicking the "Calculate Averages" button, the input is parsed into individual numbers, and the arithmetic mean, geometric mean, and harmonic mean are calculated using their respective formulas. The calculated averages are then displayed in separate sections below the button.
Screenshots(Attach 2 screenshots of your own input and output) -

By raising this PR I affirm that -

[x] My code follows the guidelines of this project.

[x] I have performed a self-review of my own code.

[x] I have commented my code.

[x] My code gives the correct output.

[x] I affirm that I strictly follow contributing guidelines and code of conduct.

Congratulations 🎉 @its-kumar-yash on your contribution.
Thanks for adding value to this repository. 😊
Let's celebrate this fest 😃 by providing more developers 👨💻👩💻 an opportunity to contribute. Help us make this repository reach far and more by sharing this to your friends and colleagues.
Your efforts can make difference.

Hey 👋, may you also encourage us by clicking the star icon on the repository main page. ⭐


Create Loading states for all charts

Description

We want to have a loading state with an svg drawing and an animation for each chart
Possible Solution

Use SVG and CSS animations
Context

Making our user experience awesome for asynchronous loading charts

To prevent loading states from becoming too literal, line and area charts (including the multiple values variants) will be using the same loading states.
https://github.com/eventbrite/britecharts/pull/451


Update docs home page to add link back to landing and remove redundant blog

remove blog as its redundant from the landing page and add a link back to the landing page from the doc

Or we can do backlinks to the blogs from the landing page?