Add watch-only mode

closes #238
Changes
Note: by being optional I mean replacing type T with type Option<T>.

UnifiedSpendAuthority replaced with WalletCapability

See #238 for more details.

WalletCapability as ReadableWriteable<()> version incremented to 2, while staying compatible with version 1 UnifiedSpendCapability as ReadableWriteable<()>
LightClient::create_with_seedorkey_wallet renamed to LightClient::new_from_wallet_base

and its argument seed_or_key: Option<String> replaced with wallet_base: WalletBase

pub enum WalletBase {
    FreshEntropy,
    SeedBytes([u8; 32]),
    MnemonicPhrase(String),
    Mnemonic(Mnemonic),
    Ufvk(String),
}

UnifiedSpendAuthority: Into<SomeKey> replaced with WalletCapability: TryInto<SomeKey>

i.e. all these conversions are WalletCapability failable

arguments orchard_ivk and sapling_ivk of TrialDecryptions::trial_decrypt_batch are optional now
field mnemonic of LightWallet is now optional
LightWallet::serialized_version() incremented to 27 to enable optional mnemonic serialization
LightWallet::send_to_address_inner returns error in watch-only mode
field extsk of SpendableSaplingNote and field spend_key of SpendableOrchardNote are now optional
added ExtendedPubKey struct as complement of ExtendedPrivKey
added secp256k1::SecretKey: ReadableWriteable<()>
added OrchardSpendingKey: ReadableWriteable<()>
added SaplingExtendedSpendingKey: ReadableWriteable<()>
added --viewing-key argument for zingo-cli :sparkles:

PR is ready for review @AloeareV
commits should be be squashed before merging
there are no test scenarios at the moment . I will add some , this or next week . I tested on my own and everything was working as expected :sparkles:
cc: @zancas

Sure, making enum Capability #[non_exhaustive] is definitely appropriate. I didn't know about this attribute.

I will focus on tests now.

One other ask I have is to make a type, for the Error variant of Results returned from public fns.

commits squashed . this is no-op

conflicts resolved . this PR is ready to be merged

I do force push one more time to rebase instead of merge.

I found a mistake when I was writing tests. I was trying to load Sapling ExtendedFullViewingKey, but only DiversifiableFullViewingKey is included in UFVK.

So I replaced Sapling Extended FVK with Diversifiable FVK (6cd0f4946e812a9a8cf455c9181c0e3ce9bb5831)
I removed TransactionMetadatSet::adjust_spendable_status (49cd06f4a20a8f8c2de9f3affa03052a742ebaad). This method requires Fvk: PartialEq, which is not implemented for Diversifiable FVK. But this method is outdated anyway. It was used in version 8 and below [source]
And I fixed scenario_mempool_clearing test (b71f4c42bbcd7907820792bbd1ae67007781e747). This test started failing, because it was using Debug print to compare curve points represented by non-normalized projective coordinates 🤷 yikwim

Tests are finished. Blocked by

#256

@zancas @juanky201271 Note that this PR makes a change to the zingolib public interface that zingo-mobile uses, renames LightClient::create_with_seedorkey_wallet to LightClient::new_from_wallet_base, and it now takes a WalletBase instead of a String as an argument.


Improvement - Reduce size of final docker image with multistage build

This draft PR transforms the main Dockerfile to a multistage build. The multistage build allows for any unnecessary files, like npm cache files, to be left outside of the runtime image reducing the final size significantly.
I calculated the following sizes before and after the changes (numbers are approximates):
Before
Uncompressed: ~3.2GB
Compressed: ~0.98GB
After
Uncompressed: ~2.3GB
Compressed: ~0.67GB
But this could be optimised even more if we review the packages that are being installed with APK:
git  python3  py3-pip  make  g++  build-base  cairo-dev  pango-dev
These packages do not seem to be necessary when installing Flowise through npm and I doubt they are actually needed in runtime. I'm not a node expert, but I'd think that any dependencies needed are installed with npm. Chrome is definitely needed for Puppeteer, so we need to keep it.
If those APK packages are not installed final image sizes are:
Uncompressed: ~2.0GB
Compressed: ~0.57GB
Any thoughts and insights on why those packages are installed is welcome.

oh wow didnt know such method exsits
those APKs are needed to all the different integration we have on Flowise, like FaiSS, Opensearch, etc. couldnt remember which APK is for which integration to work..

Cool! We can leave those in the runtime stage then.
I'll make a small change to move the PUPPETEER_SKIP_DOWNLOAD to the build stage, as I incorrectly put it in the runtime stage (it saves some time), and set the PR as ready for review.


Update meta.yaml

Attempt to un-stuck the packaging by updating the meta.yaml package version.

Hi! This is the friendly automated conda-forge-linting service.
I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.


[docs] Document all the colors available

[x] I have followed (at least) the PR section of the contributing guide.

Fix #26006
Preview: https://deploy-preview-26015--material-ui.netlify.app/customization/color/#color-palette

@anshuman9999 It's a great first pull request on Material-UI 👌🏻. Thank you for working on it!

@oliviertassinari  Thank you so much for helping me out here!

@oliviertassinari , @anshuman9999 :
Looking at the preview I saw that the gray colors of A100, A200, A400, A700 correspond with values of 100, 200, 400, 700.
Which instead happens in brown and blueGrey.
As you can see in the image those in the blue squares the values of A correspond you have values without A.
Instead the one in the red squares the values do not match.
I would like to understand why this choice, I have not found anything online.

@Angelk90 You are right, it looks like we overlooked this. Do you want to do a follow-up with?
diff --git a/packages/material-ui/src/colors/grey.js b/packages/material-ui/src/colors/grey.js
index 038768b0bc..7c1cb9d013 100644
--- a/packages/material-ui/src/colors/grey.js
+++ b/packages/material-ui/src/colors/grey.js
@@ -9,10 +9,10 @@ const grey = {
   700: '#616161',
   800: '#424242',
   900: '#212121',
-  A100: '#d5d5d5',
-  A200: '#aaaaaa',
-  A400: '#616161',
-  A700: '#303030',
+  A100: '#f5f5f5',
+  A200: '#eeeeee',
+  A400: '#bdbdbd',
+  A700: '#616161',
 };

 export default grey;


fsspec URL chaining

This is not urgent, but based on my very limited and quick testing, it seems that fsspec URL chaining may not work properly.
It is possible I was not doing it properly, or there maybe some clever way to work around the limitation, but I thought it was worth raising an issue for now.

Note: a url-chaining implementation should also support other chaining styles, see: https://github.com/zarr-developers/zeps/pull/48

Hi, I'm interested in getting this functionality. Is there a lot to do for this? If not, I could maybe have a look?

Thank you for offering to contribute!
To implement url chaining support two items have to be completed:

We need to first parse the chained url into (protocol, path, and storage options) for each protocol in the chain. All of this functionality is already available in filesystem_spec, and the function that does this in upath should rely as much as possible on the filesystem_spec implementation.
The UPath class should get an attribute (name up for debate) .chain that acts much like UPath.parents but provides access to the individual links/filesystems of the chained url. To make this work correctly, a upath instance would have to keep track of the (protocol, path, storage options) tuples before and after the current filesystem.

To provide an example of how this should look like:
# interface does not exist yet
# this is just a mockup

>>> from upath import UPath
>>> pth = UPath("simplecache::zip://path/in/archive/spreadsheet.csv::s3://mybucket/data.zip")
S3Path("simplecache::zip://path/in/archive/spreadsheet.csv::s3://mybucket/data.zip")
>>> len(pth.chain)
3
>>> pth.chain[-2]
ZipPath("simplecache::zip://path/in/archive/spreadsheet.csv::s3://mybucket/data.zip")
>>> pth2 = pth.chain[-2]
>>> pth2.with_name("other_spreadsheet.csv")
ZipPath("simplecache::zip://path/in/archive/other_spreadsheet.csv::s3://mybucket/data.zip")

When this gets implemented, there are a very likely few complications that would have to be solved. For example, the various caches implemented in filesystem_spec don't take a path, they just use the path of the next filesystem in the chain. So this should probably be special-cased in UPath somehow.
Also when instantiating UPath with a chained url, storage options should now be provided as dicts with the protocol as the target. I.e. UPath("zip://pth1::s3://bucket/pth2", zip={...}, s3={...})
I'll try to provide more information once I am back from traveling!
Cheers,
Andreas


Added new Kubernetes Cheat Sheet

What does this PR do?
Add resource(s)
For resources
Description
Why is this valuable (or not)?
How do we know it's really free?
Checklist:

[x] Read our contributing guidelines.
[x] Search for duplicates.
[x] Include author(s) and platform where appropriate.
[x] Put lists in alphabetical order, correct spacing.
[x] Add needed indications (PDF, access notes, under construction).
[x] Used an informative name for this pull request.

Follow-up

Check the status of GitHub Actions and resolve any reported warnings!

Nice.
Thanks, and welcome to free-programming-books!


 viewport width is too small for new Kobo Aura H2O firmware

For this line:
<meta name="viewport" content="width=1080, height=1430"/>
In the sample document, the width is always 1080, but it's smaller for actual files generated using KCC, correctly matching the actual width of the document.
This seems to cause a problem for the new firmware, which makes it shrink even more, and it creates a margin around the edges.
My workaround right now is to simply take a regex and replace all instances of content="width=\d+ with content="width=\d+ .

Never mind, it seems to have something to do with Stretch/Upscale, though that's slightly

Sidenote: the actual physical viewport on the H2O is 1080x1429 (top 11 pixels behind the bezel).

It looks like Calibre may be doing something to the output. Will continue testing stuff and doing diffs etc.

Sidenote: the actual physical viewport on the H2O is 1080x1429 (top 11 pixels behind the bezel).

Oh really? Maybe it's scaling the image and margining the sides by a pixel or two, or just clipping.

I think it's something on Calibre's side.


chunk upload fix#108

support large file upload in Android based on https://dev.onedrive.com/items/upload_large_files.htm spec

Are there T4 template changes associated with these updates? Are these available for review?

@iambmelt currently no 😢, the models we have in T4 templates includes expected response like UploadSession and Item, we just need a wrapper class in Android which helps us handle different response types. Due to it is not a 1-to-1 mapping between the service request and the response, I think it is hard to define it in the templates.

@daboxu Ok - am I correct in understanding that this change would have to be made by hand for the MSGraph SDK? I see that it exists within the com.onedrive.sdk.generated.* namespace, but from your explanation it sounds like it was manual. Am I understanding correctly? If that's the case, on my end, I'll have to include some unit tests to verify that these changes don't get nuked upon next regen

@iambmelt yes you are right, it is manually, like the AsyncOperationStatus class https://github.com/OneDrive/onedrive-sdk-android/blob/master/onedrivesdk/src/main/java/com/onedrive/sdk/extensions/AsyncOperationStatus.java. It is a good point and I will add UTs as well.

@daboxu Thanks for the info 👍

@daboxu Do you have link handy for the OneDrive $metadata ?

@iambmelt https://api.onedrive.com/v1.0/$metadata

@iambmelt I updated with a new interface IStatefulResponseHandler which looks like a delegate for defaulthttpprovider so it leverages the complicated response parsing duty to higher level so no more entity type at http layer anymore.

@daboxu Thanks for taking a look at that - I'm currently reviewing and testing integration into the Graph SDK. I'll post back here if I encounter any issues or have questions; I'll also let you know once my integration is complete

@daboxu Is the chunk upload functionality distinct from the AsyncMonitor stuff? Or are these changes all part of the same feature?

@iambmelt yup, the AsyncMonitor stuff is distinct from Chunk upload. Due to the change in httprovider I move the asyncmonitor analyzing to higher level handler as well.

@daboxu thanks for the update: AFAIK I won't be taking that change from you at this time

@iambmelt cool, sounds fair.

Just linking between similar issues.
msgraph-sdk-android corrollary PR can be found here


Repo sync for protected CLA branch

The pull request is created from main637865031928245258 to main to fix git push error for protected CLA branch

@huypub : Thanks for your contribution! The author(s) have been notified to review your proposed change.


externally set file value results in a 'gray' status

I know it's  most likely not a bug, but still:
for some of my fields that use filepond I sometimes set their values outside of FilePond component, by setting its value using 'options' (as it is described in documentation).
The value I set is for instance:
"options": {
      "type": "local",
      "file": {
        "name": "ph_version.xlsx",
        "size": 404370,
        "type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
      }

It works fine, with one caveat:
those files that are 'uploaded' by setting the filepond value externally are gray.
Like that:

While if the same file is uploaded directly via FilePond it looks like that:

Even if the values of a field in both cases are the same.
Can something be done so they both look the same (green) in both scenarios?
Versions:
 "filepond": "^4.12.0",
 "react-filepond": "^7.0.1",

Does setting type to "limbo" make a difference.

'limbo' works!

@chapkovski does limbo works? i think limbo will set a different request ?


Fixes the CDS lookup to distinguish between undetermined and not evaluated

Pretty straightforward. This work fixes a previous oversight in our CDS lookup object, fixing one of our k-v pairs and adding a new one for not evaluated: not-asked. I had to make minor adjustments to our CDS-dataAbsentReason logic, so that our Template managed these new. codes appropriately. I've also added a new test to check for dataAbsentReason specific properties.
Addl changes:

Changed a few comments in diseaseStatusUtils.js, but those are tangentially related to the main task.

Note: Also looks like more changes were made to minimal-disease-status-resource.json then actually were because of linting disparities. C'est la vie.
One Assignee should be sufficient

MG2: Minor, but thoughts on adding a row to the CSV to demonstrate this functionality in practice?


New Rule: invalid-attribute

Motivation
In the past (and apparently i'm not alone ) i had the need to prevent certain types of attributes to be used. It could be the need to prevent an onclick attribute like i asked months ago (well now it would actually be the opposite ironically) or something more general for some specific reasons i think having a way to specify a list of invalid attributes could be a good rule to have.
Description
The user can provide through rule options a list of invalid attributes/regex. Every component using such attribute will be reported.
Examples
Given a configuration like this
{
    "rules": {
        "svelte/invalid-attribute": ["error", ["title"]]
    }
}

<Foo title=""/>
<Foo {title}/>
<Foo bind:title/>
<Foo title={somevar}/>

we probably can also error on props named that way for in-repo components.
Additional comments
I got a very barebone version of this already and if interested i can work on it and submit a PR.

Why do we need to check <Foo>’s attribute? If the <Foo> component does not have a title prop, we should be able to recognize this through type checking, right?
Are you suggesting that we want to restrict something like
xxx
?

Why do we need to check <Foo>’s attribute? If the <Foo> component does not have a title prop, we should be able to recognize this through type checking, right? Are you suggesting that we want to restrict something like
xxx
?

When people create components they can add the "title" prop on a component. But now that i think about it will be more effective to check the props of the in-repo components rather than the attributes because if some external library requires a banned attribute that could be problematic.

And i think what enrico actually wanted was prevent the usage of some html attribute (like title and placeholder)


Cannot remove some paddings on LineChart

How can I remove or set this paddings (marked as red arrow and circle) ?
I didn't see any parameter related to this.

Hello! The padding to the left and right of the line is a product of the point alignment—the points are center-aligned in their segments. Try using LineChart.PointPosition.Start instead. At the moment, this leaves an empty segment at the end of the chart, but you can overcome this by using the solution described here. Regarding the marker position, you can create a custom Marker implementation that positions the bubble as desired. The MarkerComponent definition should serve as a good starting point for your class. Please see MarkerComponent#drawLabel and MarkerComponent#drawGuideline.


ability to change 'name', 'params' and 'description

Once I call neptune.create_experiment() is am unable to change: name, params, description.
I think that neptune-client should allow User to do it. My UC is that I want to append stuff to params and assign name and description right before training loop.
What do you guys think?
@lukasz-walkiewicz @jakubczakon

Well, to me params sort of define experiment and changing them/appending them during the experiment goes against it. I see how this would make code nicer in some situations. To marry both worlds I would suggest that we have an option to .add_parameter which cannot overwrite anything, but let's you add new params. @kamil-kaczmarek ?
When it comes to name and description it's a different story. It would make sense to me to append things to description during the experiment and have an autogenerated story passed to description.
The same story for name I think.

no longer relevant


Add support for using reusable recipes

It'd be nice to use reusable recipes directly (outside of some other recipe) too. For example, one could use this recipe to add a GitHub workflow for auto-publishing their package.
A use command perhaps would be nice. It could emulate what use command does inside of recipes: create a temporary folder, clone the recipe into the temp folder, run it, and clean the temp folder.
tmplr use loreanvictor/npm-autopublish-recipe

Implementation should also be rather straightforward, since a virtual recipe could do the trick. It should also support working directories.

Also testing reusable recipes isn't easy at the moment. Perhaps a tmplr preview:use command would help with this.


Can't launch tidal-gui 09.02.2022

Hello! I've got a problem with linking the device. Tidal doesn't accept the code. Is it temporarily?

Worked for me, started Tidal-GUi, its gave me a code, copied the code into https://offer.tidal.com/device/link and excepted, i did have to do it in a quick time otherwise errors "code timed out", then you have to restart Gui for fresh code.

Worked for me, started Tidal-GUi, its gave me a code, copied the code into https://offer.tidal.com/device/link and excepted, i did have to do it in a quick time otherwise errors "code timed out", then you have to restart Gui for fresh code.

I tried to put the code as quickly as possible, but it still errored(

It may depend on the level of account you have, unlikely to work on a free account.  Perhaps others are having similar trouble?

It may depend on the level of account you have, unlikely to work on a free account. Perhaps others are having similar trouble?

I've got HIFI Plus

Have you tried tidal-dl?  This worked for me as well although it would only download from the MASTER coded albums/songs. worth a try.  I read somewhere that updates always go to tidal.dl before Gui pro.  Other that this I would wait on the next update.

Thank you, I'll try

Have you tried tidal-dl? This worked for me as well although it would only download from the MASTER coded albums/songs. worth a try. I read somewhere that updates always go to tidal.dl before Gui pro. Other that this I would wait on the next update.

There's the same problem with tidal dl actually

Works like a charme.🙏
Don't forget to tick the box if you want Master.


validation failed

i got this :(
ERROR: Validation failed. Expected MD5: 66113859E393503A87C0CA49D3F09D38, got MD5: 4753417ED5037F334EEFB7BC8E339ACF

The error indicates that the downloaded file does not match what is actually stored on the server (it got corrupted during download).
Please post the complete log from %userprofile%\AppData\LocalLow\Bp\Better HI3 Launcher.

BetterHI3Launcher v1.5.20230730.0
Working directory: F:\Downloads
OS version: Windows 10 Pro (Build 18363.720)
OS language: en-US
Launcher language: en (autodetect)
WARNING: Bp Network connection error, attempt №2...
Using server: SEA
Using mirror: HoYoverse
Checking for game update...
Ready to install the game
Installation directory selected: E:\Apk\Honkai Impact 3
Starting to download game archive: BH3_v6.8.0_a257d1d8849b.7z (https://hk-bigfile-os-mihayo.akamaized.net/ptpublic/bh3_overseas/20230731130650_CvWDc5ChckYsPWZ1/BH3_v6.8.0_a257d1d8849b.7z)
Successfully downloaded game archive
Validating game archive...
ERROR: Validation failed. Expected MD5: 66113859E393503A87C0CA49D3F09D38, got MD5: 4753417ED5037F334EEFB7BC8E339ACF
Checking for game update...
Ready to install the game
Installation directory selected: E:\Apk\Honkai Impact 3
Starting to download game archive: BH3_v6.8.0_a257d1d8849b.7z (https://hk-bigfile-os-mihayo.akamaized.net/ptpublic/bh3_overseas/20230731130650_CvWDc5ChckYsPWZ1/BH3_v6.8.0_a257d1d8849b.7z)

what should i do?

Try downloading again. If it fails the second time, try repairing the drive you're trying to install the game or just try a different drive.

Closing due to lack of activity.


add copright

Ⅰ. Describe what this PR does
This pr is to add "Copyright 2022 The Fluid Authors" in api/v1alpha1/dataload_types.go
Ⅱ. Does this pull request fix one issue?

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews

@1134796031 Thx for your contribution. Please fix the DCO check. You can follow the instruction here

Ⅰ. Describe what this PR does
This pr is to add "Copyright 2022 The Fluid Authors" in api/v1alpha1/dataload_types.go
Ⅱ. Does this pull request fix one issue?
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews


Preview: Undo/Redo actions don't work for last deleted image (SVG or PNG) after Undo its deletion

Steps to Reproduce:

Refresh the page;
Add images on canvas (PNG or SVG) Image files:
image-png.zip
image-svg.zip
Move image to another place
Delete image using erase
Undo action - Deleting is canceled, image is on Canvas
Make Undo again (or Redo)

Actual behavior:

In case of Undo - Movement action from step 2 isn't canceled and image is still displayed on the place
In case of Redo - Deleting isn't repeated and image is still displayed

Expected behavior:

In case of Undo - Movement action from step 2 is canceled and image is changed position accordingly
In case of Redo - Deleting is repeated and image isn't displayed

Desktop:

OS: Windows 11
Browser Chrome
Version 124.0.6367.79 (Official Build) (64-bit)

Ketcher version:

[Version 2.23.0-rc.3]

Indigo version:

[Version 1.22.0-rc.3]

Additional Details:

Found during testing of https://github.com/epam/ketcher/issues/4897
Recording is attached for the case of Undo and one Image:

https://github.com/user-attachments/assets/20ad67cb-410e-435e-813a-847fdefc32f9

The issue is like that delete "resets" history of Undo/Redo of the last deleted image, you can see it on recording for two images - Undo/Redo doesn't work only for the last deleted image:

https://github.com/user-attachments/assets/9c7beaeb-2a0b-4a47-9eca-b8a9ed820827

Example of issue for two images and Redo:

https://github.com/user-attachments/assets/edf7c678-a465-4c5d-87d0-e568b51e1e40

The fix is verified on env with 5172-update-ket-image branch.

Ketcher version: [Version 2.23.0-rc.3] Build at 2024-08-01; 08:58:34
Indigo version: Version 1.23.0-dev.4.0-gb71e441d7-wasm32-wasm-clang-19.0.0
It works as expected for all cases above.
Undo/Redo actions work for the last deleted image (SVG or PNG) after Undo its deletion.

Tested. Bug fixed.
https://github.com/user-attachments/assets/d56f0641-f58e-4a37-9d77-e00c35fc0f7d
https://github.com/user-attachments/assets/7a7e67b8-0d7c-42d8-a6e0-5dbece603edc
Desktop:

OS: Windows 11
Browser Chrome
Version 124.0.6367.79 (Official Build) (64-bit)

Ketcher version
[Version 2.24.0-rc.1]
Indigo version
[Version 1.23.0-rc.1]


[WIP]fix logout remove creds from .dcoker/config.json

Changed vendor/github.com/containers/image for #2735. Removed the ./docker/config to make podman logout work when the registry only logged in by docker. If this solution is reasonable, I can create a PR in  containers/image,
or I only need to return the error message Existing credentials were established via docker login.  Please use docker logout instead.?
Signed-off-by: Qi Wang<EMAIL_ADDRESS>

removed the docker credentials, should I just change the error message? @rhatdan  @TomSweeneyRedHat PTAL?

I don't think we should do this, if a person does a docker login they should need to do a docker logout.  Podman logout should not touch the docker login program.


Optimize the N+1 query occurrence in the /api/v1/facility/ endpoint to improve performance and reduce database load.

Feature Request
Description
Optimize the N+1 query occurrence in the /api/v1/facility/ endpoint to improve performance and reduce database load.

ViewSet File: care/facility/api/viewsets/facility.py
Serializer: care/facility/api/serializers/facility.py

Suggested Solution
To address the N+1 query problem, use Django's select_related and prefetch_related methods:

Use select_related: For single-valued relationships (e.g., foreign keys, one-to-one relationships) to perform SQL joins and fetch related objects in a single query.
Use prefetch_related: For multi-valued relationships (e.g., many-to-many, reverse foreign keys) to fetch related objects in separate queries and join them in Python.

Additional Context
Optimizing these queries should enhance the endpoint's performance, reduce the number of database queries, and lower the overall load on the database.

Closing as duplicate and new solution proposed in https://github.com/ohcnetwork/care/issues/2481


Items don't always render

Seems to be an issue with iron-list where dropping in items during the draw state sometimes doesn't draw all of the items on the screen:
https://files.slack.com/files-pri/T08NJERPE-F4Z1767M2/pasted_image_at_2017_04_13_12_04_pm.png
This is intermittent in most cases, however when using the tree inside of a collapse style element it seems to always run into this issue.

Need to check if this is still an issue, hybridization may of wrapped this up for us in #51


How to solve "A BUFFER IS NOT BIG ENOUGH" error ?

Hello Friends,
Step 2: Describe your environment
I m using an mfrc522 for one project.
My OS version : Windows 8.1 Pro
Arduino IDE version : 1.8.3
MFRC522 Library version : 1.3.6
Arduino device : Arduino UNO 5V 16Mhz
MFRC522 device : NXP RC522 25 02 (This text written on SMD IC)
MIFARE Card : MIFARE1K|S50
Step 3: Describe the problem
The issue is; Normally my MRRC522 works well, but if we remove card from MFRC522 while operation is going on then some error occur like "Authentication fail","Timeout in Communication" then it will recover back.
But when it will shows "A BUFFER IS NOT BIG ENOUGH" then it will not recover back only shows this error every time.
I have tried mfrc522.PCD_Reset(); and mfrc522.PCD_Init(); function of Library but is not work, i have to compulsory restart the board altogether.
## Affected file(s) or example(s):
My code is Here :
`#include <SPI.h>
#include <MFRC522.h>

constexpr uint8_t RST_PIN = 9;     // Configurable, see typical pin layout above
constexpr uint8_t SS_PIN = 10;     // Configurable, see typical pin layout above

MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance.

MFRC522::MIFARE_Key key;
MFRC522::StatusCode status;

byte sector         = 2;
byte blockAddr      = 8;
byte dataBlock[18]  ={0};
byte trailerBlock   = 11;
byte buffer[18]     ={0};
byte size           = sizeof(buffer);

/**
 * Initialize.
 */
void setup()
{
    Serial.begin(9600); // Initialize serial communications with the PC
    while (!Serial);    // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
    SPI.begin();        // Init SPI bus
    mfrc522.PCD_Init(); // Init MFRC522 card

    // Prepare the key (used both as key A and as key B)
    // using FFFFFFFFFFFFh which is the default at chip delivery from the factory
    for (byte i = 0; i < 6; i++)
    {
        key.keyByte[i] = 0xFF;
    }

    Serial.println(F("Scan a MIFARE Classic PICC to demonstrate read and write."));
    Serial.print(F("Using key (for A and B):"));
    dump_byte_array(key.keyByte, MFRC522::MF_KEY_SIZE);
    Serial.println();

    Serial.println(F("BEWARE: Data will be written to the PICC, in sector #1"));
}

/**
 * Main loop.
 */
void loop()
{
    // Look for new cards
    if ( ! mfrc522.PICC_IsNewCardPresent())
        return;

    // Select one of the cards
    if ( ! mfrc522.PICC_ReadCardSerial())
        return;

    Serial.println(F("Authenticating using key A..."));
    status = (MFRC522::StatusCode) mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, trailerBlock, &key, &(mfrc522.uid));
    if (status != MFRC522::STATUS_OK)
    {
        Serial.print(F("PCD_Authenticate() failed: "));
        Serial.println(mfrc522.GetStatusCodeName(status));
        return;
    }

    // Read data from the block
    Serial.print(F("Reading data from block "));
    Serial.print(blockAddr);
    Serial.println(F(" ..."));
    status = (MFRC522::StatusCode) mfrc522.MIFARE_Read(blockAddr, buffer, &size);
    if (status != MFRC522::STATUS_OK)
    {
        Serial.print(F("MIFARE_Read() failed: "));
        Serial.println(mfrc522.GetStatusCodeName(status));
    }
    Serial.print(F("Data in block ")); Serial.print(blockAddr); Serial.println(F(":"));
    dump_byte_array(buffer, 16); Serial.println();
    Serial.println();

    buffer[0]=buffer[0]+1;

    Serial.println(F("Authenticating again using key B..."));
    status = (MFRC522::StatusCode) mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_B, trailerBlock, &key, &(mfrc522.uid));
    if (status != MFRC522::STATUS_OK)
    {
        Serial.print(F("PCD_Authenticate() failed: "));
        Serial.println(mfrc522.GetStatusCodeName(status));
        return;
    }

    // Write data to the block
    Serial.print(F("Writing data into block ")); Serial.print(blockAddr);
    Serial.println(F(" ..."));
    dump_byte_array(dataBlock, 16); Serial.println();
    status = (MFRC522::StatusCode) mfrc522.MIFARE_Write(blockAddr, buffer, 16);
    if (status != MFRC522::STATUS_OK) {
        Serial.print(F("MIFARE_Write() failed: "));
        Serial.println(mfrc522.GetStatusCodeName(status));
    }
    Serial.println();

    // Read data from the block (again, should now be what we have written)
    Serial.print(F("Reading data from block ")); Serial.print(blockAddr);
    Serial.println(F(" ..."));
    status = (MFRC522::StatusCode) mfrc522.MIFARE_Read(blockAddr, buffer, &size);
    if (status != MFRC522::STATUS_OK) {
        Serial.print(F("MIFARE_Read() failed: "));
        Serial.println(mfrc522.GetStatusCodeName(status));
    }
    Serial.print(F("Data in block ")); Serial.print(blockAddr); Serial.println(F(":"));
    dump_byte_array(buffer, 16); Serial.println();

    // Check that data in block is what we have written
    // by counting the number of bytes that are equal
    Serial.println(F("Checking result..."));
    byte count = 0;
    for (byte i = 0; i < 16; i++)
    {
        // Compare buffer (= what we've read) with dataBlock (= what we've written)
        if (buffer[i] == dataBlock[i])
            count++;
    }
    Serial.print(F("Number of bytes that match = ")); Serial.println(count);
    if (count == 16)
    {
        Serial.println(F("Success :-)"));
    }

    else
    {
        Serial.println(F("Failure, no match :-("));
        Serial.println(F("  perhaps the write didn't work properly..."));
    }
    Serial.println();

    // Dump the sector data
    Serial.println(F("Current data in sector:"));
    mfrc522.PICC_DumpMifareClassicSectorToSerial(&(mfrc522.uid), &key, sector);
    Serial.println();

    // Halt PICC
    mfrc522.PICC_HaltA();
    // Stop encryption on PCD
    mfrc522.PCD_StopCrypto1();
}

/**
 * Helper routine to dump a byte array as hex values to Serial.
 */
void dump_byte_array(byte *buffer, byte bufferSize)
{
    for (byte i = 0; i < bufferSize; i++)
    {
        Serial.print(buffer[i] < 0x10 ? " 0" : " ");
        Serial.print(buffer[i], HEX);
    }
}

Steps to reproduce:
Step 1 : Put card on RC522
Step 2 : Remove card from RC522 while operation is going on.
do above steps faster again and again at some instant you will get "A Buffer is not big enough".
Observed Results:
Authenticating using key A...
Reading data from block 8 ...
Data in block 8:
 01 02 03 04 05 06 07 08 08 09 FF 0B 0C 0D 0E 0F

Authenticating again using key B...
PCD_Authenticate() failed: Timeout in communication.
Authenticating using key A...
PCD_Authenticate() failed: Timeout in communication.
Authenticating using key A...
Reading data from block 8 ...
MIFARE_Read() failed: The CRC_A does not match.
Data in block 8:
 01 00 4A 24 05 06 07 08 08 09 FF 0B 0C 0D 0E 0F

Authenticating again using key B...
PCD_Authenticate() failed: Timeout in communication.

Authenticating using key A...
Reading data from block 8 ...
MIFARE_Read() failed: A buffer is not big enough.
Data in block 8:
 03 00 4A 24 05 06 07 08 08 09 FF 0B 0C 0D 0E 0F

Authenticating again using key B...
Writing data into block 8 ...
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Reading data from block 8 ...
MIFARE_Read() failed: A buffer is not big enough.
Data in block 8:
 04 00 4A 24 05 06 07 08 08 09 FF 0B 0C 0D 0E 0F
Checking result...
Number of bytes that match = 1
Failure, no match :-(
  perhaps the write didn't work properly...

Current data in sector:
   2     11   00 00 00 00  00 00 FF 07  80 69 FF FF  FF FF FF FF  [ 0 0 1 ]
         10   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  [ 0 0 0 ]
          9   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  [ 0 0 0 ]
          8   04 00 4A 24  05 06 07 08  08 09 FF 0B  0C 0D 0E 0F  [ 0 0 0 ]

Expected Results:
want to solve crc error cleared without resetting/powering up the board ?
Appreciate all the help.
Thanks

There is a reason for the github issue template. Extend your issue with your environmental information, otherwise I will close this. Thanks.

I'm sorry for inconvenience, but I'm new in GitHub,
I don't understand what you want to say please describe me in detail
Thanks
On Jun 14, 2017 4:23 PM, "Rotzbua"<EMAIL_ADDRESS>wrote:
There is a reason for the github issue template. Extend your issue with
your environmental information, otherwise I will close this. Thanks.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/miguelbalboa/rfid/issues/323#issuecomment-308396343,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AThuJjhC4S5uA92NSKx2TbvEtqZDMzXbks5sD7vCgaJpZM4N5pko
.

If you open a issue this will be shown: https://github.com/miguelbalboa/rfid/blob/master/.github/ISSUE_TEMPLATE.md
Step 2 is missing and an example/code would be good. Just edit your first post. Thanks.

What if you increase buffer size from 18 to...64, 128? Just to check.
How many attempts are on your "Observed Results"?

i don't know where is the buffer so i can't increase it.
and i was observed results greater then 50 times.

@AyushMarsian
Up in the code
byte buffer[18]     ={0};

@Freebornrus
Thanks ,
But it's for data bytes from Card and data byte of card is fix 16 data bytes and 2 checksum bytes so it's of 18 bytes (See in image).
it will never increase or nor decrease then 18, so i don't think it's creating issue.

@AyushMarsian Did you solved this problem?
Read the documentation: https://github.com/miguelbalboa/rfid/blob/1.3.6/src/MFRC522.cpp#L899
I think then you can solve your problem by your self ;) (hint: value of the pointer &size)

Thanks @Rotzbua
Could you tell me when this error will occur "MIFARE_Read() failed: A buffer is not big enough." Because that message from the library, so what part of library i have to modify (value of the pointer &size) ?
I have studied .cpp file of library and first i thought that RC522 is hanged but that error is of library and can't recover so i have to reset controller.
currently i'm continue with this
status = (MFRC522::StatusCode) mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, trailerBlock, &key, &(mfrc522.uid));
if (status != MFRC522::STATUS_OK)
{
Serial.print(" Error code ");
Serial.println(mfrc522.GetStatusCodeName(status));
if(status==4) // status code 4 means MIFARE_Read() failed: A buffer is not big enough
{
wdt_enable(WDTO_15MS);
delay(30);
}
}
please help me

The documentation tells you, that a call of mfrc522.MIFARE_Read(blockAddr, buffer, &size) change the value of size.

byte *bufferSize	///< Buffer size, at least 18 bytes. Also number of bytes returned if STATUS_OK.
) {

It seems that the documentation is not completely accurate and the value is changed also if STATUS_?? . Maybe somebody can have a closer look. Idk...
So if you call again  mfrc522.MIFARE_Read(blockAddr, buffer, &size), size would maybe contain size=0. Means your buffer is too small and function fails.
Conclusion: after you call mfrc522.MIFARE_Read(blockAddr, buffer, &size), have to reset size with size= sizeof(buffer);.
Best

Thank you so much @Rotzbua
I'll try this and come back

I Solve my Problem by adding size= sizeof(buffer); in loop
Thank you @Rotzbua @Freebornrus

@AyushMarsian could you post yout working code? I still can't manage to make it work without watchdog (which is not a bad idea anyway). Except if I remove the "return" from the status reporting block. I don't fully understand the impliction of a return in the context of loop() (for garbage collection, and proper shutdown of rfid lib)
thank you in advance!

@philippejadin Visit following URL for Download Arduino Code
https://drive.google.com/open?id=1xYrcjoMfyNnwBfhA87w_-TNlJAarJDTX
Can you explain me your problem, when you use watchdog for reset controller ?
For more query related to this mail me on<EMAIL_ADDRESS>

What works for me is to stop the card before returning :

  status = mfrc522.MIFARE_Write(block, &data[16],  16);
  if (status != MFRC522::STATUS_OK) {
    Serial.print(F("MIFARE_Write() failed: "));
    Serial.println(mfrc522.GetStatusCodeName(status));

    delay(100);
    mfrc522.PICC_HaltA();
    mfrc522.PCD_StopCrypto1();
    return false;
}

What works for me is to stop the card before returning :

  status = mfrc522.MIFARE_Write(block, &data[16],  16);
  if (status != MFRC522::STATUS_OK) {
    Serial.print(F("MIFARE_Write() failed: "));
    Serial.println(mfrc522.GetStatusCodeName(status));

    delay(100);
    mfrc522.PICC_HaltA();
    mfrc522.PCD_StopCrypto1();
    return false;
}

Hey @philippejadin  the 'The CRC_A does not match' error has nothing to do with the buffer size it means that the crc coproccesor on the MFRC522 chips calculations might have gone wrong(for some reasons that I don't know, maybe manufacturing defect after all it is a very cheap chip).
Though you can get over the problem without using the watchdog by using PCD_Reset() and PCD_init()
status = mfrc522.MIFARE_Read(block, buffer2, &len);   if (status != MFRC522::STATUS_OK) {     Serial.print(F("Reading failed: "));     Serial.println(mfrc522.GetStatusCodeName(status));     mfrc522.PCD_Reset();     mfrc522.PCD_Init();     return;   }
So now you don't have to reset the whole board !

Hi, just wanted to say I had a similar problem. From time to time the MFRC522 module would not read cards anymore.
The solution was to move PCD_StopCrypto1. I was calling it after reading authenticated sector. Now I call PCD_StopCrypto1 before calling PICC_IsNewCardPresent. Yes, every time I call PICC_IsNewCardPresent, I call PCD_StopCrypto1 before, just in case.
while (1) {
  PCD_StopCrypto1 ( );
  if (PICC_IsNewCardPresent ( )) {
    // select the card, authenticate, read block, etc... halt the card
    // ...
  }
}

I left an automated rig passing four cards all night, and the next morning it was still reading the cards successfully. Hope this helps someone else because this library is great.

What works for me is to stop the card before returning :

  status = mfrc522.MIFARE_Write(block, &data[16],  16);
  if (status != MFRC522::STATUS_OK) {
    Serial.print(F("MIFARE_Write() failed: "));
    Serial.println(mfrc522.GetStatusCodeName(status));

    delay(100);
    mfrc522.PICC_HaltA();
    mfrc522.PCD_StopCrypto1();
    return false;
}

Hey @philippejadin & @AyushMarsian the 'The CRC_A does not match' error has nothing to do with the buffer size it means that the crc coproccesor on the MFRC522 chip must have found some error in the data(for some reasons that I don't know, maybe manufacturing defect after all it is a very cheap chip).
check this out 'https://en.wikipedia.org/wiki/Cyclic_redundancy_check'
Though you can get over the problem without using the watchdog by using PCD_Reset() and PCD_init()
status = mfrc522.MIFARE_Read(block, buffer1, &len); if (status != MFRC522::STATUS_OK) { Serial.print(F("Reading failed: ")); Serial.println(mfrc522.GetStatusCodeName(status)); if(status==7) // status code 7 means the crc_a didn't match { mfrc522.PCD_Reset(); mfrc522.PCD_Init(); } return; }
So now you don't have to reset the whole board !

Massive thanks for this. I think you just saved me losing half my day.

Sry may be a late reply:
mfrc522.cpp
Search for this : if (n > *backLen) {
		return STATUS_NO_ROOM;

	}

Modify like this : if (n > *backLen) {
            *backLen = n;
		return STATUS_NO_ROOM;

	}

Every time it gets in this if statement it will reset FIFO register.

@allecsxxx Is this a fix for a bug or just an individual solution? If a fix then it would be nice to see a PR.

@allecsxxx Is this a fix for a bug or just an individual solution? If a fix then it would be nice to see a PR.

This is not a bug or so.... it is a missing bit from library. When it gets to that if statement  it will return No_ROOM and before this If statement there is nothing that alters the   backLen  value. So if you get this if statement once , program will always end there. If you look in .cpp after this if statement backLen gets n value, but too late as program ended before.
This a buffer is not big enough happens when fast card swipe is applied and comunication gets interrupted.
Basically my modification in if statement is to make next swipe of a card after "a buffer is not big enough " error to work.

I m playing with this module and library  and i encountered same issue and when it happens,  it is totally right to happen otherwise you might get incorrect data back from the card. But if it happens once doesn't mean everything must stop and restart to be aplied, just need a clear.

I think in this case a pull request would be a good idea, since the "fast card swipe" that stops the reader from working is indeed a big problem.

I quickly went again through all the lines related to issue A BUFFER IS NOT BIG ENOUGH. I could not find anything that will change "n" variable once the program gets to A BUFFER IS NOT BIG ENOUGH error, n variable gets changed after the if statement as per original library so it is enough to get into that if statement once and program will always return from there, not continuing..so because of this my suggestion above is to accept the error A BUFFER IS BIG ENOUGH and clear "n " variable so program can run again and read cards again without restarting arduino. The library does a good job , when it shows the error it is 100% right and it happens because communication is interrupted too early and it gets buggy (swiping cards too fast, fast as a rocket passing above the antenna).  I think the creator of this library missed this part and thought no one swipes 30 40 times with the speed of sound same card in front of the reader.

Use below code to continue reading
`status = mfrc522.MIFARE_Read(block, buffer2, &len);
if (status != MFRC522::STATUS_OK)
{
Serial.print(F("Reading failed status code: "));
Serial.println(status);
  mfrc522.PCD_SoftPowerDown();
delay(500);
mfrc522.PCD_SoftPowerUp();
mfrc522.PCD_Init(ssPin, RST_PIN); // re-init

}
`

@jitendra1607
Well, to reset/restart the RFID/NFC scanner is not a proper solution. And in the above case there was not a problem of RFID Scanner. The actual problem was in the size of buffer which we used to collect the data frame in controller. So, my issue only get solve when I reset the MCU of Arduino. Now, when I realized that there is problem in the variable which stores size, I just refill it every time before read or write operation.
For more look at this https://github.com/miguelbalboa/rfid/issues/323#issuecomment-323072804
Thank you

My brain's RAM could be failing, but I recall supplying a 16 byte buffer to the library and having this problem, because the library expected an 18 byte buffer to add a 2 byte CRC or something.

@AyushMarsian Please note that size= sizeof(buffer); is already there in library, so no need to do it in code.
 byte block;
 byte len;
 MFRC522::StatusCode status;

 len = 18;
 byte buffer2[18];
 block = 1;

 status = mfrc522.PCD_Authenticate(MFRC522::PICC_CMD_MF_AUTH_KEY_A, 1, &key, &(mfrc522.uid));
 status = mfrc522.MIFARE_Read(block, buffer2, &len);

Hi, just wanted to say I had a similar problem. From time to time the MFRC522 module would not read cards anymore.
The solution was to move PCD_StopCrypto1. I was calling it after reading authenticated sector. Now I call PCD_StopCrypto1 before calling PICC_IsNewCardPresent. Yes, every time I call PICC_IsNewCardPresent, I call PCD_StopCrypto1 before, just in case.
while (1) {
  PCD_StopCrypto1 ( );
  if (PICC_IsNewCardPresent ( )) {
    // select the card, authenticate, read block, etc... halt the card
    // ...
  }
}

I left an automated rig passing four cards all night, and the next morning it was still reading the cards successfully. Hope this helps someone else because this library is great.

Super thanks for this!!! I almost gave up. This solved all my troubles.

put this in the void loop and remove it from global variable it will solve the issue
byte buffer[18]     ={0};

you can change the following in the cpp file
if (bufferATQA == nullptr || *bufferSize < 2) {	// The ATQA response is 2 bytes long.
    // Reset the buffer pointer
    bufferATQA = new byte[18]; // Allocate new memory for the buffer
    *bufferSize = 18;

	return STATUS_NO_ROOM;
}

and
"	if (buffer == nullptr || *bufferSize < 18) {
// Reset the buffer pointer
buffer = new byte[18]; // Allocate new memory for the buffer
*bufferSize = 18;
	return STATUS_NO_ROOM;
}"


Disable (ignore) throttling settings

For the launch of Synthetics, there is an issue where we need to disable throttling (this will be added in again in the future).
ACs:

Synthetics should ignore any throttling settings when running the test (i.e. run with throttling disabled)
When push is used, include a message informing the user

This needs to be generic enough because throttling will be enabled again at some future point (in the case of the service, this will be independent of the Synthetics version they are running push from)
This should be added alongside a warning triangle (similar to how we currently warn about frequencies being rounded
The copy will include the URL where they can find out more information
Copy suggestion (@florent-leborgne does this seem ok to you?):

⚠ Throttling may not be active when the tests run - see https://github.com/elastic/synthetics/blob/main/THROTTLING.md for more details.

Linking to the Kibana issue: https://github.com/elastic/kibana/issues/156512

Copy LGTM, maybe instead of "see ..." have just "Learn more"

@florent-leborgne because this will be a command line response (i.e. on the console) we won't be able to have this as a hyperlink in the normal way.  It will be like this warning that we already show (but with the above content):

Oh ok! Then your suggestion LGTM, thanks.

POST FF Testing looks good, i can see message in logs


Interest in a JSON API-conformant example specification?

Hi Swagger Team,
I'm working with an API that conforms to the JSON API spec, which has a JSON Schema definition that I have translated into Swagger YAML data type definitions (with a few bits like validations commented out that either the Swagger spec or some current tool implementations don't support).
Working with this is exposing several issues for me in swagger-codegen, for example, that appear to be things the Swagger specification supports but the tools do not yet. additionalProperties: false is one example.
I'm also finding that code generated from swagger-codegen templates sometimes makes limited assumptions based on testing exclusively with Petstore, like model definitions only being objects and not arrays or primitives. The included construct in JSON API is an array, for instance, so a model of that causes issues right off the bat with generated ObjC code.
These are issues with swagger-codegen and I will and am reporting them there. But I'm wondering if a JSON API-based example might be welcomed in swagger-spec where it would be continuously validated and hopefully more likely to be adopted by the various tool projects for tests. If JSON API achieves popularity it might be a common use case, and an example spec will exercise some more advanced features that Swagger supports like polymorphic models.
If there's interest in this I'll prepare a PR for an example spec. If you think it'd be a better fit somewhere else (like just in swagger-codegen), I'm all ears, but I thought it might have worth as a more complex test case for several of the tool projects.

Thanks for reaching out, @ches.
JSON API is a design paradigm whereas Swagger is a description format. Just trying to set the expectations that the two have different goals, and it is not the general goal of Swagger to describe a specific API design format (it can certainly be done, we're just trying to remain agnostic).
Examples are welcome to join, of course, and that could be a good to the project. If you'd like, you can link us to your examples prior to submitting a PR so we'd  get a better feel of what you'd want to add.
The issue with additionalProperties: false is actually somewhat different and may require clarification in the spec about the intent, but we'll have to discuss that separately.

Thanks @webron.

JSON API is a design paradigm whereas Swagger is a description format. Just trying to set the expectations that the two have different goals, and it is not the general goal of Swagger to describe a specific API design format (it can certainly be done, we're just trying to remain agnostic).

Yep, I understand that clearly. In fact I think this description of a JSON API service is proving to be a nice example that in can be done, and it might even help people understand the distinction better if there were eventually example Swagger descriptions of APIs following a few of the well-known paradigms like HAL as well.
The actual service I've been working on is private at this time, but the description of the fundamental JSON API elements is trivial to extract. In the next day or two I'll add some example models and resources around it, perhaps adapting Petstore's would make sense.
I'll share a Gist here when I get to it.

Great, thanks. I'll reply regarding the additionalProperties over at the codegen.

Oh, and I'd be curious to be linked to the discussion about additionalProperties: false if you open it somewhere. I suspect it might have something to do with Swagger not having the same goals of providing validation as JSON Schema but I suppose I'll hear your thoughts in the appropriate forum.

Here is the appropriate forum, but since the issue came up in codegen, we'll go over it there and move it here when done.

Hey @ches, any chance to see the gist? 😊

I'm very interested on this. I use JsonApi and Swagger but the documentation is not match the schemas. [swagger-php in my case ;)]

:+1:

I struggle to with json-api
      responses:
        200:
          description: get article
          schema:
            $ref: '#/definitions/Article'

To wrap this in object data I need to do this
        200:
          description: get article
          schema:
            type: object
            properties:
              data:
                "$ref": "#/definitions/Article"

and to array in object
          schema:
            type: object
            properties:
              data:
                type: array
                items:
                  "$ref": "#/definitions/Article"

It will be great to abstract those things to be more composable. What do you think @webron ?

@onemanstartup - please take a look at https://github.com/OAI/OpenAPI-Specification/issues/519.

@onemanstartup within the limitations of 2.0 I would suggest that you keep #/definitions/Article as a valid JSON-API resource and define e.g. a #/definitions/responseOne-Article and #/definitions/Article-responseMany-Article:

"definitions": {
	"responseOne": {
		"allOf": [{ "$ref": "jsonapi.org-schema.json#/definitions/success" }],
		"properties": {
			"data": { "type": "object" }
		}
	},
	"responseMany": {
		"allOf": [{ "$ref": "jsonapi.org-schema.json#/definitions/success" }],
		"properties": {
			"data": { "type": "array" }
		}
	},
	"Article": {
		"allOf": [{ "$ref": "jsonapi.org-schema.json#/definitions/resource" }],
		...
	}
},
"responses": {
	"responseOne-Article": {
		"allOf": [{ "$ref": "#/definitions/responseOne" }],
		"properties": {
			"data": { "$ref": "#/definitions/Article" } }
		}
	},
	"responseMany-Article": {
		"allOf": [{ "$ref": "#/definitions/responseMany" }],
		"properties": {
			"data: {
				"items": { "$ref": "#/definitions/Article" }
			}
		}
	}
}

So, an operation returning a single Article would have "schema": { "$ref": "#responses/responseOne-Article" }
Yes it is a little tedious to set up, but it keeps semantic meaning, clear hierarchy of schema, and allows the Article resource schema to be used separately for eg a body parameter.

When I try Mr Trick's suggestion (above) I get swagger errors - none of the relative references in the external jsonn-api schema file cannot be resolved.
How to fix?
Sample error below is for unresolvable #/definitions/data, but the same error occurs for all jsonapi defintiions in the jsonapi schema file i.e. resources, meta, links, pagination etc.
Swagger Error
Reference could not be resolved: #/definitions/data
Details
Object
code: "UNRESOLVABLE_REFERENCE"
message: "Reference could not be resolved: #/definitions/data"
path: Array [7]
error: "JSON Pointer points to missing location: #/definitions/data"
level: 900
type: "Swagger Error"
description: "Reference could not be resolved: #/definitions/data"
lineNumber: -1

Hi @stevenxryan,
My apologies - since spending a heap more time with swagger I've discovered all sorts of horrible things...
Like how the phrase "swagger uses an extended subset of json-schema" really means "swagger breaks a heap of json-schema things for no good reason".
For example, external references? Swagger-editor and many other swagger parsers do not understand them. You'll have to inline them.

Ah well, thanks for the insight. Saves me from eating any more time. Unfortunate, but at least now I know it's not just me being daft !
I had a quick crack at adding the Jsonapi scenario inline, but got a bunch of errors.
Any idea if it can work, or better not to waste time?My other option is to not include the Jsonapi schematic, instead just copy/plagiarise the bits I really need - a subset and none of the fancier stuff.

@stevenxryan I've got something duct-taped together that swagger seems for the most part to accept: https://gist.github.com/MrTrick/2a46a65eee763b2f5a9c

Thanks for sharing, much appreciated.
And I do like the well-named dumbDown().

in elixir/phoenix someone made a jsonapi module for swagger:
https://github.com/xerions/phoenix_swagger

If someone wants to contribute more/better examples covering more API styles, we welcome them, but given that it's been 6 years since the last comment and it's not something the OpenAPI maintainers need to track, I'm going to close this.


AOP中如何调用私有类和私有方法？

1.AOP中如何调用私有类和私有方法？
2.AOP如果拦截Initializes方法？
3.能不能新增一个可以给所有函数插桩的注解？可以用来实现打印方法耗时等功能。 @kangwang1988

@Kila2
As to 1, I think a mirror implementation based on dill transformation could do the trick.
As to 2, currently, constructor hooking is not supported yet.
As to 3, I have plans to support specifying a aspect by regex expressions.

Update:
Hook for constructors has been implemented now.

Update:
Regex support for specifying a aspect has been supported since: https://github.com/alibaba-flutter/aspectd/commit/f84eb3de805452d6952ed03de5d8ae4378ead7c4

Da ge, wo men ke yi yong zhong wen jiao liu ma?

Aspectd正则貌似只支持不支持


invalidate_cached_property can unintentionally delete object attributes

I have following class:
class Example(object):

    def __init__(self):
        self.foo = "Important data"

In case I pass standard attribute of the object to invalidate_cached_property it results in foo attribute being overwritten by no value object:
In [1]: from script import Example

In [2]: from werkzeug.utils import invalidate_cached_property

In [3]: e = Example()

In [4]: e.foo
Out[4]: 'Important data'

In [5]: invalidate_cached_property(e, "foo")

In [6]: e.foo
Out[6]: no value

I believe that such thing can happen by mistake and invalidate_cached_property should be a noop for standard attributes. CC @singingwolfboy

i believe a warning should trigger as well, simply to make users aware of the issue,
else its easy to miss a typo when the code "works"


B06

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

B06 first

Hi there, wrong repo; please use your own


[Snyk] Security upgrade express from 4.17.2 to 4.21.2

Snyk has created this PR to fix 1 vulnerabilities in the npm dependencies of this project.
Snyk changed the following file(s):

package.json
package-lock.json

Vulnerabilities that will be fixed with an upgrade:

Issue
Score

Regular Expression Denial of Service (ReDoS) SNYK-JS-PATHTOREGEXP-8482416
  157

[!IMPORTANT]

Check the changes in this PR to ensure they won't cause issues with your project.
Max score is 1000. Note that the real score may have changed since the PR was raised.
This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.
For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic

Learn how to fix vulnerabilities with free interactive lessons:
🦉 Regular Expression Denial of Service (ReDoS)

:tada: Snyk checks have passed. No issues have been found so far.
:white_check_mark: security/snyk check is complete. No issues have been found. (View Details)
:white_check_mark: license/snyk check is complete. No issues have been found. (View Details)


Update partition finalizer to use full path prefix instead of just the prefix

Please add description for the PR


Improve API for creating IslandManager

IslandManagers are actors so that they can respond to messages about emigration of solutions. However, this means that you cannot construct them explicitly, and you need an implicit ActorSystem to call IslandManager.from(…).
This is a confusing API, and even we forget exactly what steps are required to construct an IslandManager. We should allow the constructor to be called directly by making it have an instance of an actor instead of being an actor.

Also, this would remove the need to terminate the actor system after an island manager finishes running.


Migrate subcommands code with discord_app

LC-Dailies contains subcommands to register players and render leaderboards. discord_app is a Deno library used to simplify the subcommands code.
Reference

https://deno.land/x/discord_app

Reference

https://jsr.io/@fartlabs/rtx

Resolved in https://github.com/acmcsufoss/lc-dailies/commit/9571bb1bb04c5dfafa8ecd817415b209e4eb4480 (#56).


Shiny App for Twitter Data Analysis

Writing an introductory hands-on tutorial for Shiny apps and creating a Shiny app that makes it easy for non-technical users to scrape and analyze Twitter data.
A running version of the application is available at: https://jason-young.shinyapps.io/twitter-analysis/.
The code and an introductory hands-on tutorial can be found in the following repository.

The app has been rolled out and is available at: https://jason-young.shinyapps.io/twitter-analysis/.
The final version of the code and an extensive  documentation including an introductory Shiny tutorial can be found in the public SMO-TMAS repository.


Remove lead_organisations & supporting_organisations

These have been deprecated. We've ensured that all lead_organisations and supporting_organisations have been merged into organisations (https://github.com/alphagov/whitehall/pull/2585), so the data will be the same.

The overall change makes sense to me but I don't know how the analytics work (eg are those tags arbitrary or does something need cleaning up elsewhere?).
👍  to merge if you are happy with it.

This partial generates a meta tag, which is used by analytics. Nothing more to change. Happy for this to get merged.

👍


Add headphoneVirtualise sub-element to audioBlockFormat (all typeDefinitions).

2076-2 defines a new headphoneVirtualise sub-element
It is optionally present in audioBlockFormats of all type definitions.

The headphoneVirtualise element specifies whether the content of the audioChannelFormat should be rendered with headphone virtualisation. The element consists of two attributes: “bypass” and “DRR” (Direct-to-Reverberant ratio). The bypass attribute  is  a  1/0  flag  that  signals  whether  the  content  should  be  rendered  using  a headphone virtualiser (value of 0) or renderer to stereo (value of 1). The DRR attribute defines the Direct-to-Reverberant-Ratio (DRR) in dB. This can be given in the range of −130dB to 130dB with 130dB meaning anechoic (all direct sound)

Initially calling the attribute types Bypass and DirectToReverberantRatio as equivalents are not used elsewhere.

Should Bypass be more specific, e.g. HeadphoneVirtualiseBypass?
Should DirectToReverberantRatio match the xml attribute name (DRR)?

As HeadphoneVirtualise is optional, should the blockFormat have a default value for it, or return has<HeadphoneVirtualise>() = false and get<HeadphoneVirtualise>() = boost::none unless set explicitly?
For now, setting a default value as is done for JumpPosition.

Adding this to all block format types (objects, binaural, directSpeakers, HOA, matrix) but it's only listed in the sub elements table for objects (BS.2076-2 5.4.3), although then later mentioned as common to all type definitions (9.4).


expand all tabs in sound.c

This PR tries to make more manageable to review https://github.com/vim/vim/pull/13318#discussion_r1824562098 by simply expand the tabs into spaces and modifying the modeline

Thanks. I have included it now and also added a new file: https://github.com/vim/vim/blob/master/.git-blame-ignore-revs to ignore this revision for git-blame.


WMS ID 708 and 11131 (OCW HOLs 19 and 40)

Add here your WMS ID
General requirements

Information in the workshop is adequate and updated
Code is correct and working
Links are correct
Make sure you enter the help email link in your manifest.json
Please make sure WMS URLs are updated as needed after your PR is approved

Checklist - Refer to the QA document for the complete list
Please confirm that the following is completed before submitting your PR

[x] All filenames are lower case (including folders, images, files, etc.)
[x] Filenames are descriptive
[x] Your workshop folder structure should be similar to the one used in the sample workshop (https://github.com/oracle-livelabs/common/tree/main/sample-livelabs-templates/sample-workshop)
[x] Are you using multiple versions (desktop/, sandbox/, tenancy/)? Make sure that each of them contains a manifest.json and an index.html
[x] Image references in markdown contain an alternate text

The following were done before last PR:

Please remove changes to files that do not belong to your workshop
Include the workshop’s WMS ID in the title of the PR
Please add workshop URL to session #40 in WMS


Color setting conflict in gm.gen_pointcloud

When generating the point cloud, the pcd_pdndp data will first be transferred to the StaticGeometricModel, as the following line.
https://github.com/wanweiwei07/wrs/blob/6895529ee09d0ceef8052991803a24386fb51ce8/modeling/geometric_model.py#L1125
However, the StaticGeometricModel will set the model as a predefined color by default, as the following line:
https://github.com/wanweiwei07/wrs/blob/6895529ee09d0ceef8052991803a24386fb51ce8/modeling/geometric_model.py#L116
This raises the color setting conflict (I guess this conflict also exists in other gen_xxx functions).

True. Corrected.


add obscured_open to geoprivacy API and obs/search URL

I'd like to be able to do calls like:
https://www.inaturalist.org/observations?quality_grade=research,needs_id&taxon_id=62274&geoprivacy=obscured,open
similar to the existing
https://www.inaturalist.org/observations?quality_grade=research,needs_id&taxon_id=62274&geoprivacy=obscured,private
so private obs can be excluded in not-in-atlas queries (e.g. https://www.inaturalist.org/atlases/1812)
@pleary does this seem doable?

seems to be fixed https://www.inaturalist.org/observations?quality_grade=research,needs_id&taxon_id=62274&geoprivacy=obscured,open


[DOCFIX] Update docs/cn/Configuring-Alluxio-with-OBS.md

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Alluxio-Pull-Request-Builder/20499/
Test PASSed.


feat: add functions for parsing formatters from encoding

🏆 Enhancements

Add functions for parsing formatters from encoding

LGTM as well


Feature/ocu 184 allow binaries and containers to be built for architectures different than amd

As per title, allow to customise the built images and binaries for 🍎 people and documenting the utilisation.
We basically use --platform when building to specify for which platform we want to build an image. At the same time we can customise for which architecture the Go binaries should be built for.

Based on the supplied ARCH and OS, a binary is created in a self-documented sub-folder, as follows:

It would be nice to collapse the different Dockerfiles and Makefiles in components into a single one, so such customisation can be centralised. I'll start a thread in the chat about it.

Tested locally:

make components -> builds with linux/amd64 by default. Running the containers works fine.
make GOOS=linux GOARCH=arm64 CONTAINER_OS_ARCH=linux/arm64 components -> builds with linux/arm64. Running the containers work.
make GOOS=darwin GOARCH=arm64 component-binaries -> build with darwin/arm64 and I can exec the binaries fine on my machine.

I would appreciate if you can try these commands yourself and if you have other pointers to what to test.

Minor: bumping remark-cli to v12.0.1 to suppress formatting errors.

Closed in favour of https://github.com/ocurity/dracon/pull/350/files


Storing binary data and JSON data in the same database

Can LevelDB database as value store binary data (file content) and JSON data (custom file metadata) for the same key in the same data store simultaneously?
Or should I manage 2 data stores - the first is for file metadata (with valueEncoding = JSON ) and the second store for file content (valueEncoding = binary)  - probably using level-store?

@hellboy81 Closing this. Please reopen this issue if you aren't satisfied with your answer.


7.0.x issue with ClassCastException

I get the following error updating to latest versions of butterknife (7.0.0 and 7.0.1):
Error:Execution failed for task ':myapp:compileDebugJava'.

java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$VarSymbol cannot be cast to javax.lang.model.element.TypeElement
li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

Not quite sure, but when I downgrade to 6.1.0 all errors are gone.

Hi, you should look at this: #303

And read changelogs when upgrading.


scroll to current element on selection

should fix https://github.com/rangle/batarangle/issues/148

LGTM :ship:


Tendon simulation in Brax

I'm looking to simulate a tendon within Brax so that I can model a dexterous hand and train an RL agent to move it naturally.
This works in Mujoco right now by treating the muscle connected to the tendon as a 0 length actuator whose force depends on how contracted the 'muscle' is. Ie. the tendon actually changes length based on the force applied to it.
I'd like to have a go at implementing this and potentially submitted a PR - does anyone have any tips on how this might be implemented best within the Brax framework.
Thanks!

Hello!
I'd expect this to look very similar to our angle-actuator defined here: https://github.com/google/brax/blob/main/brax/physics/actuators.py#L72
Do you have a particular form for the biodynamics you're trying to model beyond modulating the actuator spring constant?

Heya
Thanks for the tip on the angle actuator - it seems like it could be very useful. The scenario I want to be able to model is a tendon attached to a contracting muscle that goes over a number of pulleys (cylinders that can rotate) and finally connects to a bone (capsule). Then when the muscle contracts it has the effect of shortening the tendon and generating a force which is translated through the pulleys to the bone (capsule) at the end.
I think the various forces involved aren't actually all that complex - its just that there's quite a lot going on all at once in order to model a single tendon!


Angular 6, 7 - error TS1192: Module '".../node_modules/deepmerge/index"' has no default export.

Currently i see the following error:

But it gets fixed when i change index.d.ts from this:
declare function deepmerge<T>(x: Partial<T>, y: Partial<T>, options?: deepmerge.Options): T;
declare function deepmerge<T1, T2>(x: Partial<T1>, y: Partial<T2>, options?: deepmerge.Options): T1 & T2;
declare namespace deepmerge {
	export interface Options {
		arrayMerge?(target: any[], source: any[], options?: Options): any[];
		clone?: boolean;
		isMergeableObject?(value: object): boolean;
	}

	export function all (objects: object[], options?: Options): object;
}
export = deepmerge;

To this (added default export):
declare function deepmerge<T>(x: Partial<T>, y: Partial<T>, options?: deepmerge.Options): T;
declare function deepmerge<T1, T2>(x: Partial<T1>, y: Partial<T2>, options?: deepmerge.Options): T1 & T2;
declare namespace deepmerge {
	export interface Options {
		arrayMerge?(target: any[], source: any[], options?: Options): any[];
		clone?: boolean;
		isMergeableObject?(value: object): boolean;
	}

	export function all (objects: object[], options?: Options): object;
}
export default deepmerge;

You may see a similar issue for another Angular component here (react-day-picker)

Which version of deepmerge?
deepmerge 3.0.0 was released without an ESM export because Webpack is broken.
Upgrade to deepmerge@3 and switch to import * as deepmerge from 'deepmerge' and everything should work correctly, including the type definitions.

Yup, upgrading to 3.0.0 fixed it, thank you @TehShrike :)


full_message config expect field name, not dynamic value

Thanks for contributing to Logstash! If you haven't already signed our CLA, here's a handy link: https://www.elastic.co/contributor-agreement/

This code indicates to me that the full_message setting supports dynamic (sprintf) values. Also, the comment above the config setting says that %{foo} values are valid.
What problem does this fix for you?


[🐛] GH_TOKEN property added to env

:tada: This PR is included in version 1.0.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Add a sitemap generation

It needs a sitemap plugin/package that automatically generate a sitemap.
Or we can write our own.

#70


pythonPackages.ldaptor: fix build

Motivation for this change
Add missing dependencies.
ZHF: #80379
Things done

[x] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
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 nixpkgs-review --run "nixpkgs-review wip"
[ ] 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)
[ ] Ensured that relevant documentation is up to date
[x] Fits CONTRIBUTING.md.

@GrahamcOfBorg build python38Packages.ldaptor python37Packages.ldaptor python36Packages.ldaptor python35Packages.ldaptor


Implement RequestContent

Used in method parameters that take a body.

Sorry @RickWinter , @LarryOsterman. I was targeting the wrong base again. Hopefully this PR looks more palatable...and reviewable :wink:


Change log paths to store logs in /data/adb/modules/YAKT

Updated the LOG and ERROR_LOG paths to /data/adb/modules/YAKT/yakt.log and /data/adb/modules/YAKT/yakt-logging-error.log, respectively.
Ensured that the necessary log functions still work correctly after the path change.

This change is made to improve the log storage location for the Yakt v12 script.
Contributor: @CRANKV2

Make it /data/YAKT/yakt.log its more accessible and fix your commit name like do this: "yakt: Changed log path"

Make it /data/YAKT/yakt.log its more accessible and fix your commit name like do this: "yakt: Changed log path"

Done 😉


pip support

Thank you for making cupyimg possible.
Are you planning to add cupyimg to pip anytime soon so that people can add this library to their requirements.txt in their projects?

It would be easy enough to put a source release on PyPI, but I am a bit reluctant to do it as the current plan is to move this repository under NVIDIA's RAPIDS organization instead. That way it can benefit from automated testing on GPU hardware, etc. prior to making an official release. See cupy/cupy#3531 for the initial discussion related to this. I have had some correspondence via email with NVIDIA regarding the logistics of the move, but do not yet know when the new repository will become available. I intend keep this repository here as well, but will probably mark it as ARCHIVED once the migration to RAPIDS is complete.
The new RAPIDS cuImage module will probably contain only the things currently under the cupyimg.skimage module. I am in the process of porting the items from cupyimg.scipy and cupyimg.numpy upstream to CuPy itself.
Out of curiosity, which functions are you primarily interested in? If there are still functions missing that would be important for your application, please let me know as that may aid in deciding which features to implement going forward.

Thanks for providing a detailed reply! I am interested in using gradient, polyfit, and poly1d functions, which aren't readily available in Cupy.

polyfit was recently merged into CuPy master: cupy/cupy#3747 and there is an open PR containing poly1d at cupy/cupy#3547
IIRC, a contributor had offered to work on gradient over there as well, but I don't think it ever materialized. I will try to port the gradient function from here when I get a chance. It is pretty easy to copy over the function, but it takes some time to expand the tests and get them to match CuPy's style.


Autogen fix

Replaces #1464 to try and fix the autogen fun and games with Travis!

As travis is green, I'm going to merge this and try re-opening the autogen PR


ItemGroupFromSeparatedList build task should accept an empty string and return an empty ItemGroup

ItemGroupFromSeparatedList build task should accept an empty string and return an empty ItemGroup
This work item was migrated from CodePlex
CodePlex work item ID: '6054'
Assigned to: 'tfabraham'
Vote count: '0'

[UnknownUser@2/18/2010]
Resolved with changeset 36776.

[UnknownUser@2/21/2013]

[UnknownUser@5/16/2013]


Seems to error / funky behavior on the thrid animation set?

Hi,
I've been using this plugin on Blender 2.93.3, and trying to separate by animation set (using Control Animations). Usually the first two Animation Sets will render into separate spreadsheets fine, but on the third one and after, it starts to have funky behavior. I'll either get a notification error that the JSON file isn't found, or it'll break up a 30-frame animation into multiple files (and the JSONs look funny)

Hi,
I haven't noticed anything like this personally. I don't have much time to maintain this these days I'm afraid, but if you can attach a .blend file that shows this behavior, I can try to take a look.

Thanks! See attached...i'm continuing to look into it as well, though I've never dived into add-on code before in blender.
blueprime.zip
Note that I did follow instructions per this issue on addressing the Time.clock() issue. Not sure if that's related.
This is an awesome plugin btw, thank you for offering this to the world!

Sorry it took so long to get to this, but I think it's fixed! I just released v2.2.2. Please let me know if that solves it!

Closing this to clean up the issues queue, but please reopen if you still notice any problems.


Configure Azure Pipelines

This configuration builds the application and produces builds for both Debug and Release configurations.

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


Support extending existing enums

It should be possible to declare an enum using another enum as a starting point. Right now the only thing that can be done is copy/paste the enum you want to extend. Options for this mechanism include spread-like syntax or enum extends syntax.
Open questions include:

How does this affect assignability? E.g. if I have enum Child extends Base { }, can I pass Base.A for Child? Can I pass Child.A for Base when A came from Base?
How does this overlap with the Azure notion of "extensible enums", if at all? E.g. do we need some kind of opt-in mechanism for an enum to allow others to extend it?

Somewhat of an aside but, assuming extends syntax for this, you could imagine using this to create the notion of extensible enum we have today. Recall that it involves declaring both an enum and a string and passing the enum to a decorator on the string. We could perhaps have:
enum AnyStringButProbablyOneOfTheseStrings extends string {
  Good,
  Bad,
}

Which has a good feeling to me but I haven't thought through all the implications of yet.

A strong argument against extends for this is that in all other cases extends creates subclasses. For enums, it does the opposite (if anything).
Using spread syntax is a possibility, but we need to decide if it's sugar (i.e. Base.A isn't the same type as Child.A because it's as if you declared them in the different enums) or if there is some sort of more meaningful relationship between these enums.
My opinion is that the former is the only workable solution as the latter is unlikely to be representable in any target language.

Cards on the table: I'm heavily leaning toward the spread sugar approach to solve the main scenario.
One other note is that OP calls out a way to do "extensible enums" by extending some base type. This is a fine usage of extends because it does in fact create a subtype in the sense that the enums values are all subtypes of the extended type.

Alternately we could use something closer to set semantics, like contains
enum bar {
  One: "1",
  Two: "2",
  Three: "3"
}
enum foo contains bar  {
  Four: "4",
  Five: "5",
  Six: "6"
}

I think if we use spread sugar, like
enum foo {
  ... bar;
  Four: "4",
  Five: "5",
  Six: "6"
}

then it is fair that foo.One !== bar.One, but it should be the case that foo.One.name === bar.One.name and foo.One.value === bar.One.value

Design Meeting Consensus was to go with the spread syntax, above

Closing for implementation issue #591


Project crashes after starting because breakpoint

Tested versions
v4.3.beta.custom_build [60844997b]
System information
Windows 11
Issue description
Breakpoints make my project crash a few seconds after running from the editor. It works if I remove them all or set it after the project is already running. The number and place of the breakpoints don't seem to matter.
The project starts and runs for about two seconds. The "Saving Scene" dialogue is 100% but still open in the editor. After this popup closes, the project keeps running for a few seconds but then silently crashes, probably when it tries to attach the debugger.
Log:
Godot Engine v4.3.beta.custom_build.60844997b (2024-05-30 09:48:18 UTC) - https://godotengine.org
WARNING: GENERAL - Message Id Number: 0 | Message Id Name: Loader Message
        windows_read_data_files_in_registry: Registry lookup failed to get layer manifest files.
        Objects - 1
                Object[0] - VK_OBJECT_TYPE_INSTANCE, Handle<PHONE_NUMBER>088
     at: RenderingContextDriverVulkan::_debug_messenger_callback (drivers\vulkan\rendering_context_driver_vulkan.cpp:30)
Vulkan 1.3.260 - Forward+ - Using Device #0: NVIDIA - NVIDIA GeForce RTX 3070

================================================================
CrashHandlerException: Program crashed
Engine version: Godot Engine v4.3.beta.custom_build (60844997bb2981c44e3b4396ab2918df90f13c97)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[0] <couldn't map PC to fn name>
[1] _CxxThrowException (D:\a\_work\1\s\src\vctools\crt\vcruntime\src\eh\throw.cpp:75)
[2] __RTDynamicCast (D:\a\_work\1\s\src\vctools\crt\vcruntime\src\eh\rtti.cpp:291)
[3] Object::cast_to<GDScriptNativeClass> (C:\godot\godot\core\object\object.h:805)
[4] GDScriptLanguage::debug_get_globals (C:\godot\godot\modules\gdscript\gdscript_editor.cpp:406)
[5] RemoteDebugger::debug (C:\godot\godot\core\debugger\remote_debugger.cpp:506)
[6] ScriptDebugger::debug (C:\godot\godot\core\debugger\script_debugger.cpp:86)
[7] GDScriptLanguage::debug_break (C:\godot\godot\modules\gdscript\gdscript_editor.cpp:272)
[8] GDScriptFunction::call (C:\godot\godot\modules\gdscript\gdscript_vm.cpp:3599)
[9] GDScriptInstance::callp (C:\godot\godot\modules\gdscript\gdscript.cpp:2050)
[10] Object::callp (C:\godot\godot\core\object\object.cpp:819)
[11] Variant::callp (C:\godot\godot\core\variant\variant_call.cpp:1211)
[12] GDScriptFunction::call (C:\godot\godot\modules\gdscript\gdscript_vm.cpp:1739)
[13] GDScriptInstance::callp (C:\godot\godot\modules\gdscript\gdscript.cpp:2050)
[14] Object::callp (C:\godot\godot\core\object\object.cpp:819)
[15] Variant::callp (C:\godot\godot\core\variant\variant_call.cpp:1211)
[16] GDScriptFunction::call (C:\godot\godot\modules\gdscript\gdscript_vm.cpp:1768)
[17] GDScriptInstance::callp (C:\godot\godot\modules\gdscript\gdscript.cpp:2050)
[18] Node::_gdvirtual__physics_process_call<0> (C:\godot\godot\scene\main\node.h:352)
[19] Node::_notification (C:\godot\godot\scene\main\node.cpp:60)
[20] Node::_notificationv (C:\godot\godot\scene\main\node.h:50)
[21] Object::notification (C:\godot\godot\core\object\object.cpp:906)
[22] SceneTree::_process_group (C:\godot\godot\scene\main\scene_tree.cpp:957)
[23] SceneTree::_process (C:\godot\godot\scene\main\scene_tree.cpp:1042)
[24] SceneTree::physics_process (C:\godot\godot\scene\main\scene_tree.cpp:491)
[25] Main::iteration (C:\godot\godot\main\main.cpp:4016)
[26] OS_Windows::run (C:\godot\godot\platform\windows\os_windows.cpp:1686)
[27] widechar_main (C:\godot\godot\platform\windows\godot_windows.cpp:181)
[28] _main (C:\godot\godot\platform\windows\godot_windows.cpp:206)
[29] main (C:\godot\godot\platform\windows\godot_windows.cpp:220)
[30] WinMain (C:\godot\godot\platform\windows\godot_windows.cpp:234)
[31] __scrt_common_main_seh (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[32] <couldn't map PC to fn name>
-- END OF BACKTRACE --
================================================================

Steps to reproduce
Not sure. Anywhere I put a breakpoint makes it crash.
Minimal reproduction project (MRP)
I can reproduce it every time in my project but I was unable to get a minimal example to do the same.

I found the cause. It happens when an autoload is deleted at startup like this:
var _free_on_start = true

func _enter_tree() -> void:
	if _free_on_start:
		queue_free()

Godot adds the autoload to the script server globals at startup but when the debugger checks these globals, the autoload object is invalid.
https://github.com/godotengine/godot/blob/705b7a0b0bd535c95e4e8fb439f3d84b3fb4f427/main/main.cpp#L3605C1-L3614C6
https://github.com/godotengine/godot/blob/705b7a0b0bd535c95e4e8fb439f3d84b3fb4f427/modules/gdscript/gdscript_editor.cpp#L404C3-L409C4

You shouldn't delete autoloads, as documented


Clarification about the meaning of an empty security array

Hi, while I was trying to implement the specification, I ran into some existential questions about security requirements!
It's unclear to me if an empty security array ([]) is equivalent to a security array with an empty object ([{}])... The spec doesn't even mention if it would be valid to have an empty security array at the OpenApi Object level and what would that mean...

OpenAPI Object

A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition. To make security optional, an empty security requirement ({}) can be included in the array.

Operation Object

A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. To make security optional, an empty security requirement ({}) can be included in the array. This definition overrides any declared top-level security. To remove a top-level security declaration, an empty array can be used.

The empty object here is just a normal Security Requirement Object that doesn't have any entries.  And therefore does not require any security requirements to be fulfilled.  It does not have any special behavior - it is just the natural outcome of how the Security Requirement Object works that an empty object allows everything.
Since the OpenAPI Object and the Operation Object take arrays of Security Requirement Objects which are logically OR'd, an empty requirement list also allows everything.
You can stuff as many empty Security Requirement Objects into the array as you want, they still all get evaluated the same way, which means that [], [{}], and [{}, {}, {}, {}, {}] all behave the same.  It's like adding multiple trues to an OR.  true OR true OR true is still true.

Thanks for your explanation 💡
We thought for a moment that an empty security array [ ] meant that nothing is allowed whereas an empty security requirement object [{}] allowed everything 😅
@rvedotrc here is your answer

Since the OpenAPI Object and the Operation Object take arrays of Security Requirement Objects which are logically OR'd, an empty requirement list also allows everything.

So you're saying logical-OR is defined for zero operands, and the result of that is "true", right?
I'm just checking because it seems like a fairly commonly accepted thing that if one defines "AND" or "OR" for zero operands, then the result is the opposite of what you just said.
For example, in Ruby, where "all" / "any" are analagous to "AND" / "OR":
irb(main):001:0> [].all?
=> true
irb(main):002:0> [].any?
=> false

or indeed in Javascript:
❯ node
Welcome to Node.js v22.5.1.
Type ".help" for more information.
> [].every(Boolean)
true
> [].some(Boolean)
false
>

If one is going to define AND/OR for zero operands, then conventionally one defines AND-of-nothing to be true, and OR-of-nothing to be false.
So, I'm just checking. Thoughts?

There seems to be a fair amount of debate on this in #3995, so let's not consider this resolved just yet.

It's not about what's allowed, it's about what's required
'[]' - no security requirement
'[{}]' - a single 'allow anyone' security requirement

The list [ ... ] is about what's allowed.
The object { ... } is about what's required.

Isn't English funny?

The list [ ... ] is about what's allowed.

This way [] would mean nothing is allowed, which is not the case. It means that nothing is required.
One could say, it's a list of gate keepers. You can go thru either one, and if there's not gate keeper, you're free to enter.

[] would be an equivalent of [{}]

Current consensus: no, these are not equivalent, see https://github.com/OAI/OpenAPI-Specification/pull/3995#issuecomment-2276266713

The correct behaviour for an empty array is unclear. We think it is widely used to mean that there's no security applied ("allow all") - but logically it means that there are no security rules that can be fulfilled to permit access.
We do need to update wording to explain that the empty security array is ambiguous in the current spec versions.

Current proposal:

#4007

Don't use this unless you have verified that all tools in your tool chain (and the tool chains of your partners, customers, ...) interpret it the same way

This is exactly why we added "implementation defined" as a description.  Which I think is where we ended up in the TDC call?  (For 3.0.4 and 3.1.1 anyway).

I spent some time this weekend thinking this through and I now believe that the current spec as written is clear and requires no changes. The key to understanding the current wording is to view it in the context of the "Open World" philosophy we have adopted for OpenAPI descriptions.
"Open World" vs "Closed World" was discussed and debated extensively way back in the day in Issue #568. The conclusion was that OpenAPI descriptions are a contract that describe "what works and how", but do not preclude things not described from working. So for example, if a path is not listed in the set of paths, this does not mean it does not work. Likewise, if a parameter is not listed in the parameter list for an operation, this does not mean that the operation will not accept it / use it.
Extending this to security / security requirements (perhaps "requirement" is a bad name in this regard), this means that "if a security requirement is listed, it should work", but not "if a security requirement is not listed, then it does not work". In other words, there is no way to define when a security requirement will not work in OpenAPI, just as there is no way to define a path that does not work, or an operation parameter that does not work.
At both the OpenAPI level and operation level, the description of the security field says:

The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request.

This is consistent with the "Open World" philosophy. It says "these are things that work". It does not and should not say "things not in this list do not work".
In this list, I think we can clearly answer the question that started all this unambiguously based on the current language in the spec:
An empty security array means "No security requirement is declared to work". It does not mean "none work".
The absence of a security field means the same thing:  "No security requirement is declared to work", but operations may accept security requirements as OpenAPI definitions are "Open World" contracts.

@mikekistler I have to say that I agree with your logic here, and I'm also trying to figure out why it feels a bit odd.  I think that's because I think of security as an area where people are trying to close off possibilities.
We've previously discussed places where it makes sense to allow closing off a "world".  For example, JSON Schema allows setting additionalProperties: false or (more flexibly) unevaluatedProperties: false, because the API provider owns the entire thing being described by the schema.  This is also why we eventually agreed to consider closing off the set of URL query string parameters (#2511, #1502): the URL is owned by the resource, which is owned by the API provider.  And while there are use cases for additional query string parameters (tracking info, for example), whether to allow such things or not is still under the control of the resource.  And as we discussed with that example,  it doesn't matter if it's a "good" or "bad" idea to close off that set, the point is that the API provider owns it.
So coming back to security, I definitely agree that if the field is not present, it's an open world "we're just not giving you any information here, and you can't assume that means anyhting one way or the other" situation.
Philosophically, I think the API provider controls the set of authentication mechanisms, and should be able to say "just these and no more" for the same reason as being able to close other fully-owned spaces.  However, two points suggest that this is not allowed:

The Operation Object states that security: [] removes the security field from the OpenAPI Object, which I interpret as restoring the "no security field at all" condition, which I agree is an open-world scenario
We have a section on security filtering, which can result in an API Description with an empty Paths Object.  This does not mean that there aren't any paths, just that there aren't any path that the reader is allowed to know about.  Treating security: [] as a similar filtered list would be consistent.

So I think I end up agreeing with you in practical terms according to what the OAS is established to mean, while still philosophically agreeing with @rvedotrc that being able to close the set of authentication mechanisms would have made more sense.
I think it might be worth adding a section on open world / closed world implications that we can reference in fields where it is particularly significant.  The section should note that in some cases OAS (or JSON Schema) allows "closing" a world.
I'll also note that we're not consistent with the open world: the set of HTTP methods is, according to the HTTP spec, open, yet we have closed it.  Which is a point of significant ongoing frustration for our users (see #1747 for a consolidated issue of all of the requests over the years).  So any section on this philosophy needs to account for the exceptions.

I have to say that I agree with your logic here, and I'm also trying to figure out why it feels a bit odd.

@handrews Haha I have the same experience.
I think for me it's the fact you can make a story (open world concept, gate keepers) that makes anything logical.
@mikekistler Notice how you write (perhaps "requirement" is a bad name in this regard)... well perhaps that "requirement" name exempts it from the Open World concept?
How about "there are no keys to open these doors"? Sounds logical, doesn't it.
I agree with @ralfhandl, it should remain undefined.

@handrews You say:

I'll also note that we're not consistent with the open world: the set of HTTP methods is, according to the HTTP spec, open, yet we have closed it.

I don't see it quite that way. OpenAPI says that you may describe only a certain set of HTTP methods. It does not say that your service must not accept any undescribed HTTP methods.

@mikekistler Fair enough.  It bothers me to have a part of our spec that is philosophically inconsistent with another spec (allowing only a fixed subset for an open set), but you are correct that it can be framed within an open world assumption.

I now believe that the current spec as written is clear

I'm trying to square that statement with the amount of discussion that has happened under this issue / the PRs. If the current spec is clear, how is it that we have spent so long discussing what it means?
I don't think it's clear.

I agree with @mikekistler's reasoning and the conclusion that

the current spec as written [...] requires no changes

Adding some explanation probably would not hurt, given the length of this discussion.

We could add something along the lines of:
Unless explicitly stated otherwise, OpenAPI Descriptions are not assumed to be complete.  Additional endpoints, authentication or authorization mechanisms, parameters, headers, methods, data formats, etc. MAY be present within the API without being described.  Use cases for this assumption include but are not limited to Security Filtering.

I think the current wording around using {} in the array to make security "optional" is sufficient to indicate that [{}] is unambiguously "you don't need to passy any security, and we're not telling you anything about how you would do such a thing if you wanted to."

Clarified in 3.0.4 and 3.1.1, port to 3.2.0 in progress. Closing the issue.