Private to Public TypeScript keyoword

Per the RC.0 Changelog:

Change any uses of the private TypeScript keyword to public.

Is there a reason for this? What prompted this change?
Thanks,
Vladimir

Hello, thanks for using Ionic! This is because of the Angular AoT compiler. If you set a method or variable as private and try to use it in your template it will throw an error. Sorry for any hassle this causes!

@vbudilov AoT cant access private properties, details:
https://forum.ionicframework.com/t/rc0-typescript-private-vs-public-keyword/64863/4?u=olmerius

Thanks!

@jgw96 So Change any uses of the private TypeScript keyword to public. should be something like Make sure any Component properties that you use in your template are set to public.

Is it have to be explicit? If there is no public/private prefix it will work?


Token input

The token input does not work outside of main stream (i.e.: in profile, circles, groups ,etc.).

The route to audiences.json is hard coded!


Default content styling

[X] Add fallback font
[X] Add Favicon
[X] Adjust media breaks, as/if required

Media points incorporated as is present in current site:

Desktop (>1080px)
Tab (768px< and <1080px)
Mobile (<768px)


Interval annotations on charts broken in master

Bug description
Annotation layers of type "Interval" no longer seem to appear on line charts in master. They are fine in 4.02-dev and 4.1.0rc2-dev but not on master.
It does not matter if the source is a 'Superset annotation' or a 'Table'.
How to reproduce the bug
This uses the examples datasets.

Spin up the latest development image: TAG=994de1f-dev docker compose -f ./docker-compose-image-tag.yml up -d
Go to 'Settings -> Annotation Layers'.

Click + Annotation layer button
Give the layer a name
Click Add

Click on the name of the new annotation layer

Click + Annotation button
Give the annotation a name
Set the start date to 2000-01-01 00:00:00 and end date to 2004-01-01 00:00:00
Click Add

Click Charts in the navigation bar

Click + Chart
Select the birth_names dataset
Select the Line Chart type
Click Create new chart

Configure the chart

Drag the ds column to X-axis
Drag the num column to Metrics, choose the Sum aggregate and click Save
Scroll down in the configure panel and click Annotations and Layers followed by + Add annotation layer
Give the layer a name
Check the Show label box
Change the Annotation layer type to Interval
Change the Annotation source to Superset annotation
Change the Annotation layer to the name given to the newly created layer in step 2
Click OK
Click Update chart

I cannot see any errors in the superset logs. I've attached a screenshot of an error in the Firefox console.
Screenshots/recordings

Superset version
master / latest-dev
Python version
3.10
Node version
18 or greater
Browser
Firefox
Additional context
No response
Checklist

[X] I have searched Superset docs and Slack and didn't find a solution to my problem.
[X] I have searched the GitHub issue tracker and didn't find a similar bug report.
[X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

@martyngigg https://github.com/apache/superset/pull/30348 should have fixed the bug. Closing this issue, feel free to reopen if the bug persists

@kgabryje Yep looks good in my example now. Thanks!


Stop flow when business errors are found in the collector

Coverage increased (+0.009%) to 87.48% when pulling 11ccd70470e20611fb2dbf9bc0db216bebb1bf70 on KRuelY:collectorFlow into fdff8b75a78d2b40c55a4830b0059b94213a32df on cloudfoundry-incubator:master.


Components in an {{#each}} within an {{#if}} might not get teardown

Description:
I have an {{#each items}} which gets executed only {{#if items.length}}, and inserts multiple components <MyComponent/> in the page.
Removing an element from items will trigger teardown for each instance of <MyComponent/> except the last one.
Looks like the {{#if items.length}} is getting in the way.
{{#if items.length}}
    {{#each items}}
        <MyComponent label="{{label}}"/>
    {{/each}}
{{/if}}

Versions affected:
0.10.9 (reproduced also on 0.10.4)
Platforms affected:
All
Reproduction:
JSFiddle.
Same JSFiddle, without the {{#if items.length}}
const MyComponent = Ractive.extend({
  template: '
Hello there {{label}}
',
  onteardown() {
    this.parent.add('teardownCounter');
  },
});

// if you change your console context to "result", you can interact with
// your Ractive instance with the glboal "r"
const r = window.r = new Ractive({
  el: '#main',
  template: `

Tore down components {{teardownCounter}}. Should be: {{teardownCounterShouldBe}}

    {{#if items.length}}
      {{#each items}}
        <MyComponent label="{{label}}"/>
      {{/each}}
    {{/if}}
  `,

  components: {
    MyComponent,
  },

  data: {
    // number of components tored down by splicing `items`
    teardownCounter: 0,
    teardownCounterShouldBe: 0,

    items: [{
        label: 'item 1'
      },
      {
        label: 'item 2'
      },
    ]
  },

  oncomplete() {
    setTimeout(() => {
      // will trigger a teardown properly
      this.splice('items', 0, 1)
      this.add('teardownCounterShouldBe')
    }, 1000)

    setTimeout(() => {
      // will not trigger a teardown for MyComponent!!
      this.splice('items', 0, 1)
      this.add('teardownCounterShouldBe')
    }, 2000)
  },
});

Edit 1: this example uses setTimeout(), but the same happens when splicing interactively (ex. clicking a button)

Obviously it's all about timings: https://jsfiddle.net/cb1sd27u/17/

Yup, my actual code is much different and removes components interactively via a button.

I've tracked this down to an issue wherein a shuffled out item never gets fully unbound when its parent fragment unbinds before it can finish shuffling. I think I've got it fixed, but I need to write a few tests, which I'll try to do when my brain is a bit more functional :smile:

This should be fixed on edge and v0.10-dev once travis finishes travising. Thanks for the report!

Thanks Chris!
While this is fixed on my example, I'm still experiencing the issue on my app.
I'm trying to figure out what's going on but, as always, it's in a super deep component structure 😅
I'm working on a fiddle, though the only strange thing I discovered so far is #3265. Could that be somehow related? No idea yet..
My scenario involves decorators within {{#if ...}} and {{#each ...}}, however the simplest cases have been already fixed by d99c5a0.
Will update if I can isolate the problem.


Topic/macro def

Submitting for review. It works, but needs some polish before it's ready to be merged.

What are you after in Relations?
Should we base scripted tests on 2.10.0-M2?

With Relations, I was trying to think of how it would work when you use a macro defined in a binary.  With hasMacro being in Source, I don't think sbt will properly (for even a weak definition of properly) handle changes to macros in a binary dependency.
Yes, 2.10.0-M2 is good for tests.


ColorAxis Error Fixed [Update highcharts.py] , Heatmap Hover Color Error Fixed [Update common.py]

The color axis always appears, even if it's not set in some charts like; line charts, spline charts, column charts, etc.
I've fixed this error by updating highcharts.py .

The heatmap can't be updated to change the hover color like this url: http://jsfiddle.net/sgurhhm0/1/
I always get an error when I try the following:
self.H.add_data_set(yData,'heatmap',Data_Name,states={'hover': {'color': 'red'}})
I've fixed this error by updating the Hover class in common.py

Merged into v0.3.0. Thanks!!


Updated characters in leet speak transformer

Type of change:

[ ] Refactor
[ ] Performance improvement
[ ] New feature
[ ] Bug fix
[x] Other (please describe): Functionality improvement

Please describe the changes this PR makes and why it should be merged:
This MR updates some characters in the leet speak transformer, so it can detect profanities such as 5h1t, 5h!t, 0r645m and more.
Status:

[x] I've added/modified unit tests relevant to my change / not needed
[ ] This PR contains breaking changes
[ ] This PR doesn't include changes to the code

Thanks for the PR. Would you mind rebasing and changing the target branch to dev instead of main? (Sorry this isn't made clear in the contribution guidelines.) If not, I'm happy to do it for you when I merge this change. FYI, I'm busy for the next month or so and a more thorough review and release will likely be delayed. You can of course use this updated transformer in your own code with the current version.

Closed in favor of https://github.com/jo3-l/obscenity/pull/78


provide dll for windows distributions

we should provide binaries for windows distributions.

This issue complements #3

@gastaldi ^^


arcanist: generate & install bash-completion

Arcanist only supports bash for shell-completion as of 20200711, otherwise I would include zsh and/or fish here.
Upstream discussion of zsh non-support: https://secure.phabricator.com/D19700
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)
[x] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[x] Tested execution of all binary files (usually in ./result/bin/)
[x] Determined the impact on package closure size (by running nix path-info -S before and after)
[x] Ensured that relevant documentation is up to date
[x] Fits CONTRIBUTING.md.

Any objection to merging this now?


vote: vote for release Seata 1.2.0

Signed-off-by: slievrly<EMAIL_ADDRESS>
Ⅰ. Describe what this PR did
vote: vote for release Seata 1.2.0
at least 3 votes with binding to pass
Please vote accordingly:

[x] +1 approve
[x] +0 no opinion
[x] -1 disapprove with the reason

Codecov Report

Merging #2580 into develop will decrease coverage by 0.16%.
The diff coverage is n/a.

@@              Coverage Diff              @@
##             develop    #2580      +/-   ##
=============================================
- Coverage      51.20%   51.04%   -0.17%
+ Complexity      2807     2804       -3
=============================================
  Files            554      554
  Lines          17774    17754      -20
  Branches        2101     2062      -39
=============================================
- Hits            9101     9062      -39
+ Misses          7816     7810       -6
- Partials         857      882      +25

Impacted Files
Coverage Δ
Complexity Δ

.../src/main/java/io/seata/core/protocol/Version.java
0.00% <ø> (ø)
0.00 <0.00> (ø)

...obuf/convertor/BranchRegisterRequestConvertor.java
90.47% <0.00%> (-9.53%)
3.00% <0.00%> (ø%)

...otobuf/convertor/BranchReportRequestConvertor.java
90.90% <0.00%> (-9.10%)
3.00% <0.00%> (ø%)

...obuf/convertor/BranchRollbackRequestConvertor.java
92.00% <0.00%> (-8.00%)
3.00% <0.00%> (ø%)

...otobuf/convertor/GlobalBeginResponseConvertor.java
92.59% <0.00%> (-7.41%)
3.00% <0.00%> (ø%)

...otobuf/convertor/GlobalCommitRequestConvertor.java
93.75% <0.00%> (-6.25%)
3.00% <0.00%> (ø%)

...otobuf/convertor/GlobalStatusRequestConvertor.java
93.75% <0.00%> (-6.25%)
3.00% <0.00%> (ø%)

...obuf/convertor/GlobalRollbackRequestConvertor.java
93.75% <0.00%> (-6.25%)
3.00% <0.00%> (ø%)

...protobuf/convertor/RegisterTMRequestConvertor.java
94.73% <0.00%> (-5.27%)
3.00% <0.00%> (ø%)

...protobuf/convertor/RegisterRMRequestConvertor.java
90.47% <0.00%> (-4.77%)
3.00% <0.00%> (ø%)

... and 23 more

+1 binding

[ ] Dubbo MySQL commit/rollback  file mode
[ ] Dubbo MySQL commit/rollback  db mode
[ ] Spring Cloud  MySQL commit/rollback  file mode

+1 non-binding

+1 binding

+1 non-binding

+1 binding

+1 non-binding

+1 binding

+1 non-binding

+1 non-binding

+1 binding

+1 non-binding

+1

we have received 7+5 (binding)votes for release 1.2.0.

+1 non-binding


Add ability to search for specific information from schemas

I tested it with Roman data and it does what I think it should do.
In [33]: cal.schema_info('title', 'roman.meta.ephemeris.velocity_x')
Out[33]: {'title': SchemaInfo(info='[km/s] X component of Roman velocity', value=10)}

In [34]: cal.schema_info('description', 'roman.meta.guidestar.gs_pattern_error')
Out[34]: {'description': SchemaInfo(info='RMS of guide star position in guide window from pattern matching (error on centroid not explicitly calculated, the FACE information takes all the centroids and calculates the error across the guiding pattern)', value=0.0)}

Should we accept an AsdfSearchResult object in schema_info for the path argument in addition to the dot separated string?

That would be nice to accept AsdfSearchResult, but I suspect we should leave that for a subsequent PR.


Host name conflict, retrying with hassio-xx

Problem/Motivation
Homebridge won't start up and get stuck in a loop with a Host name conflict.
Expected behavior
Expect homebridge to start and to produce a 'Key' for the Home.app
Actual behavior
Keeps trying to start service then fails and tries again with a new host name.
Steps to reproduce
Standard steps to add add-on
Proposed changes
No sure.
Example of log:
Host name conflict, retrying with hassio-19
Registering new address record for fe80::473e:1cc1:fccc:1af7 on vetha58f892..
Registering new address record for <IP_ADDRESS> on vetha58f892.IPv4.
Registering new address record for fe80::786e:31ff:fec6:1b78 on veth175236b..
Registering new address record for <IP_ADDRESS> on veth175236b.IPv4.
Registering new address record for fe80::a1db:7d77:9e6f:9e14 on docker0..
Registering new address record for <IP_ADDRESS> on docker0.IPv4.
Registering new address record for <IP_ADDRESS> on docker0.IPv4.
Registering new address record for fe80::3802:117a:5c87:c173 on hassio..
Registering new address record for <IP_ADDRESS> on hassio.IPv4.
Registering new address record for <IP_ADDRESS> on hassio.IPv4.
Registering new address record for fe80::d435:ef2d:f54a:aaa2 on wlan0..
Registering new address record for <IP_ADDRESS> on wlan0.IPv4.
Registering new address record for fe80::a5e3:9aca:38b3:2173 on eth0..
Withdrawing address record for fe80::473e:1cc1:fccc:1af7 on vetha58f892.
Withdrawing address record for fe80::786e:31ff:fec6:1b78 on veth175236b.
Withdrawing address record for <IP_ADDRESS> on veth175236b.
Withdrawing address record for fe80::a1db:7d77:9e6f:9e14 on docker0.
Withdrawing address record for <IP_ADDRESS> on docker0.
Withdrawing address record for <IP_ADDRESS> on docker0.
Withdrawing address record for fe80::3802:117a:5c87:c173 on hassio.
Withdrawing address record for <IP_ADDRESS> on hassio.
Withdrawing address record for <IP_ADDRESS> on hassio.
Withdrawing address record for fe80::d435:ef2d:f54a:aaa2 on wlan0.
Withdrawing address record for <IP_ADDRESS> on wlan0.
Withdrawing address record for fe80::a5e3:9aca:38b3:2173 on eth0.
Host name conflict, retrying with hassio-20
This just keeps repeating, hassio-21, 22 etc and never starts.
I'm trying to run this on a raspberrry pi 2, raspbian.
Any ideas?
Thanks

Anyone?

I have the exact same issue. Did you fix this yet?

No sadly. I've had it produce the code, but still not show up on iOS. Check the log again and it stuck in that loop again. Please let me know if you figure it out. Cheers

Sadly I have not been able to solve this issue either. I have tried to do some digging on the internet but was not able to find anything except for this post. Guess we will have to wat for the developer to figure it out or something.

 I am running this in a regular Linux enviroment and what I have read if i'm not wrong it's a know issue. It should be fixed in 1.1.0. Not sure if my info is correct but we just have to wait and see.

@invamped I found the fix!. I had to change something in my avahi config.
I had to do the following nano /etc/avahi/avahi-daemon.conf and edit host-name to say host-name=hassio. Then doing sudo service avahi-daemon restart and start the homekit addon. I am not getting the error anymore in the logs! Hopefully this will work for you too.

@jay448 Did you make that change on the linux host, or in the container? Because the container already has the config file as you specify https://github.com/hassio-addons/addon-homebridge/blob/d214ce440836bc137823d27f272e3df39e45541f/homebridge/files/avahi-daemon.conf#L2

@stickystyle I changed it on my Linux Host. This worked for me. Hopefully it will for you too.

Hey! Sorry for the late reply, but @jay448 your solution worked for me also. HA now shows up under iOS and controls work great. Thanks for your help.
Thanks


Missing first option when using the

Hi,
I'm not a JS/HTML guru, so I'm unsure how to describe the problem adequately...
Even when setting all options as selected, the first is missing from the tag list.
I have created an example that is as simple as possible to mimic the problem.
https://jsfiddle.net/nkxutpv7/

yes that's basically because typically the first option would be "please select..." something
if you don't provide a placeholder or something, it's going to take the first option as the placeholder


Cannot connect to Docker Engine since v1.19

Hello,
After upgrading to v1.19 (running HA 2027.7.1), I cannot connect any more to my docker engine.
I got the following error when starting home assistant in the log file:
2024-07-06 01:48:02.797 ERROR (MainThread) [custom_components.monitor_docker] Failed Docker connect: DockerError(900, "Cannot connect to Docker Engine via tcp://<my_ip>:2376 [Cannot connect to host <my_ip>:2376 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unsuitable certificate purpose (_ssl.c:1000)')]]")
Here is the docker configuration in my configuration.yaml file:
monitor_docker:
  - name: Docker Prod
    url: tcp://<my_ip>:2376
    certpath: /config/docker_certs
    monitored_conditions:
      - allinone

<my_ip> being replaced by a real lan ip address
My certificate files have been properly generated for a while. It was perfectly working with the previous version (in particular v1.8). Coming back to v1.18 makes it work again.

Can you modify the "custom_components/monitor_docker/manifest.json" to the line:
"requirements": ["aiodocker==0.21.0", "python-dateutil==2.8.2"]
Basically downgrading the aiodocker version. Check if after restart the problem persists. Also, are you using the following environment variables:
environment:
- DOCKER_TLS_VERIFY=0
- DOCKER_CERT_PATH=/certs

Thanks for the quick answer. It is actually fixing the issue. What is the lasting solution ?
I do not use the variables you are referring to.

Ok, the problem is in the underlying library. I will try to do a diff on it.

Can you modify the "custom_components/monitor_docker/manifest.json" to the line: "requirements": ["aiodocker==0.21.0", "python-dateutil==2.8.2"]
Basically downgrading the aiodocker version. Check if after restart the problem persists. Also, are you using the following environment variables: environment: - DOCKER_TLS_VERIFY=0 - DOCKER_CERT_PATH=/certs

I'm experiencing the same issue. I tried the suggested steps, but the Docker information only appears for a few seconds before disappearing again. I’ve verified manually using the command line (docker -H tcp://:2375 ps) and can see the Docker info there.
Below is the error in the log:
Container not available anymore (3a) (DockerError(900, "Cannot connect to Docker Engine via tcp://:2375 [Cannot connect to host :2375 ssl:default [Connect call failed ('', 2375)]]"))

I also have this issue, however it only just showed itself when updating to HA 2024.12.1.
The fix suggested above doesn't repair it in this case.

I'm getting a different error starting in 2024.12, however the same fix @ualex73 posted also fixed it for me.
Failed Docker connect: DockerError(900, "Cannot connect to Docker Engine via http://<server>:2376 [Cannot connect to host <server>:2376 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: CA cert does not include key usage extension (_ssl.c:1020)')]]")


Installation fails

Currently, bob does not work until openai and anthropic are installed. Unfortunaty, both are not mentioned in the environments.yml file.

... ok this only happens in case "claude" is stored in the config, but you start from an environment, where anthropic is not installed.

solved in #152


[AutoPR eventgrid/data-plane] EventGrid Py conf to 1.0.0

Created to sync https://github.com/Azure/azure-rest-api-specs/pull/2955

This PR has been merged into https://github.com/Azure/azure-sdk-for-go/pull/1709


Feature request: negative transport time notation

Hi!
I'm experimenting with the loops from Steve Reich's Electric counterpoint, where each guitar line is played in an offset compared to each other. I'm playing the loops using Parts, where I can say, that I start playing one sequence from 0:0:0, another from 0:0:4, yet another from 0:0:10, but there is no way to specify offsetting in the other direction with negative values. I've tried 0:0:-6 and -0:0:6, but none of them worked.
I can calculate this using -Tone.Time(`0:0:{loopSize - Math.abs(offset)}`).toSeconds()  ( or -Tone.Time(`0:0:${24-6}`).toSeconds() ), where it works perfectly, but it would be nice to have this feature among the time encoding formats: https://github.com/Tonejs/Tone.js/wiki/Time
Having this feature would mean, that Part should go to the end of the loop (based on the loopEnd property) and go backwards Math.abs(-0:0:x) amount and start the looping from that point.
Note: there is something called "now relative" in the wiki page, but it is only for seconds and only in the + direction.
Here is a jsfiddle, where I illustrate this: https://jsfiddle.net/lmeszaros/yL1zx78u/57/

I looked into this a bit, but there seems to be some circular logic that i couldn't wrap my head around. Currently loop duration is loopEnd - loopStart, but if loopEnd is a value which is relative to the loop duration, how could it be computed?
If you've got an elegant solution for this, happy to accept a PR. but i'm going to close for now.


[Snyk] Security upgrade org.openapitools:openapi-generator from 5.2.0 to 5.3.0

Snyk has created this PR to fix one or more vulnerable packages in the `maven` dependencies of this project.
As this is a private repository, Snyk-bot does not have access. Therefore, this PR has been created automatically, but appears to have been created by a real user.
Changes included in this PR

Changes to the following files to upgrade the vulnerable dependencies to a fixed version:

pom.xml

Vulnerabilities that will be fixed
With an upgrade:

Severity
Priority Score (*)
Issue
Upgrade
Breaking Change
Exploit Maturity

624/1000  Why? Has a fix available, CVSS 8.2
XML External Entity (XXE) Injection SNYK-JAVA-COMFASTERXMLJACKSONCORE-1048302
org.openapitools:openapi-generator:  5.2.0 -> 5.3.0
No
No Known Exploit

596/1000  Why? Proof of Concept exploit, Has a fix available, CVSS 5.5
Information Disclosure SNYK-JAVA-COMGOOGLEGUAVA-1015415
org.openapitools:openapi-generator:  5.2.0 -> 5.3.0
No
Proof of Concept

651/1000  Why? Mature exploit, Has a fix available, CVSS 5.3
Directory Traversal SNYK-JAVA-COMMONSIO-1277109
org.openapitools:openapi-generator:  5.2.0 -> 5.3.0
No
Mature

(*) Note that the real score may have changed since the PR was raised.
Check the changes in this PR to ensure they won't cause issues with your project.

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
🛠 Adjust project settings
📚 Read more about Snyk's upgrade and patch logic

Fixed by https://github.com/twilio/twilio-oai-generator/pull/98


SystemUiVisibility overwritten bug

Make StatusBar style respect previously set systemUiVisibility

Motivation
I tried to set SystemUiVisibility flag to SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR to enable Android's light soft navigation bar, but when I had <StatusBar /> component in my view, then it was always overwritten. This is how I found the bug and fixed it.
Test Plan

In MainActivity you can set systemUiFlags like this in onCreate method

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            Window window = getWindow();
            View rootView = window.getDecorView().getRootView();
            rootView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
        }

Add  to a view
In android/app/build.gradle file set targetSdkVersion to 27 instead of 22 or something like that
In android/app/src/main/res/values/styles.xml add 2 lines to AppTheme

        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:navigationBarColor">#ffffff</item>

Run the app.
Test. Previously bottom soft navigation bar was set to white and buttons also to white (so they weren't visible anymore), because StatusBar was overwriting previously set systemUiVisibility Flags. Now the bar should be white and buttons dark as expected.

Previous buggy android bottom navbar

New fixed android bottom navbar

Related PRs
This pull request does not change any existing feature. It only makes StatusBar coloring work more properly without affecting bottom navigation bar on android or any other system ui visibility feature.
Release Notes

[ANDROID] [BUGFIX] [StatusBar] - Fixed StatusBar overwriting previously set SystemUiVisibility flags

I checked the ci/circleci: test-android and the failure is not because of my code changes but instead some third party library missing. Can you still validate this specific pull request?


Study backend

To merge needs:

images tested and working
verification def'n delay is ~<4 seconds, fix if not
specify the name of vtt to use to generate


Pass User-Agent info to container that has the CLI in it

Have you tested this locally?

The injector itself needs the following updates:

Update go dependencies (may require Go 1.19)
Change AdmissionResponse from v1beta1 to v1
Add the MetaType content to make the response complete:TypeMeta: metav1.TypeMeta{
    APIVersion: "admission.k8s.io/v1",
    Kind:       "AdmissionReview",
}

Add the vendor directory in the repo by running go mod vendor
Adjust the Dockerfile to get the proper files needed in the right way
Add some scripts that generate and place the certificate in your Kubernetes cluster. NOTE: This is subject to change since we may want to do this step on the fly, when the webhook is deployed.

The working injector can be found in the test-env-inject branch.
I have tested the working version of the injector and indeed in the response it passes the User-Agent info required for the CLI.

As long as this has been tested and verified to work I am happy with this :)


[NOREF] Add LCID and Expiration Date to portfolio report CSV

NOREF
Description

Adds lcid and lcidExpiresAt fields to portfolio report CSV
How to test this change

scripts/dev up
scripts/dev db:seed
Log in as an admin user
Run portfolio export report targeting the -30 days to +30 days as a date range
Ensure fields show up properly

[!NOTE]
LCIDs sometimes appear formatted as numbers (i.e. leading 0's stripped), but this is often just your CSV viewing program doing this. Open the file in a text editor to see the true values being output!

[!NOTE]
Want to see an example of an output from the testing instructions above?
EASi-Portfolio-Update-Report.csv

PR Author Checklist

[ ] I have provided a detailed description of the changes in this PR.
[ ] I have provided clear instructions on how to test the changes in this PR.
[ ] I have updated tests or written new tests as appropriate in this PR.

PR Reviewer Guidelines

It's best to pull the branch locally and test it, rather than just looking at the code online!
When approving a PR, provide a reason why you're approving it

e.g. "Approving because I tested it locally and all functionality works as expected"
e.g. "Approving because the change is simple and matches the Figma design"

Don't be afraid to leave comments or ask questions, especially if you don't understand why something was done! (This is often a great time to suggest code comments or documentation updates)
Check that all code is adequately covered by tests - if it isn't feel free to suggest the addition of tests.

Flagging with do not merge until I get confirmation this is all the IT Gov team wants added!


Use configmap to determine aws account limit

ticket
Remove hard coded account limit from the operator. Since different environments have different account limits we should look for the given limit in the operator's ConfigMap.

@fahlmant @ArielLima If we create a configmap locally we should be able to test this, right?  Then update the configmap through the separate paths we expect it to take?

I manually tested this by running the checkAWSAccountsLimitReached function at the beginning of the reconcile loop and everything worked as expected. Aside from creating unit tests which already have a separate dedicated card this looks good to me.
@rogbas @fahlmant @iamkirkbater


Can we have example for Ti Classic

This is not an issue. This is request.
Please provide Ti Classic example.

Ti.Classic doesn't have widgets.

Thank you Sir. Do you know any notification module similar to your widget for classic. Sorry to ask here. Please suggest if you know.

No, I don't know...
The question is, why do you use Ti.Classic instead of Alloy?


unpermitted_parameters logging?

When config.action_controller.action_on_unpermitted_parameters = :log is set, Rails 4 can emit an "unpermitted_parameters.action_controller" event, which is normally handled by the default LogSubscriber, but lograge uses its own subscriber so the unpermitted parameters never got logged. Would it make sense for lograge to handle that event and add it to the log line automatically if it's set? By default the action_on_unpermitted_parameters config is unset so it would never show up in the log, but if you've explicitly set that config, it would.

I like this idea.
A PR is very welcome. :dancers: so we have a base for discussion.
The default behaviour should be off I think. And people can enable it when they need it.


Added Collate Notes

Added Collate Notes to Awesome Vue.

I didn't even realize there was a Commercial products section!
I moved Collate to the section and added a link to the section to the TOC.

Hey sorry about that.
Not sure how it got deleted the first time.  I re-added it.


filtering data base on user premession or roles

 public class RestrictedItemGlobalFilter : GlobalFilter
     {
        public IIdentityManager IdentityManager { get; set; }
        public override void ApplyFilter(DbModelBuilder modelBuilder)
        {
            modelBuilder.Filter("RestrictItemsBaseOnAccsess",
                (IAccessRestrictedItem x, List<string> roles) => x.AccessType == AccessType.Public
                         || roles.Any(x.AllowedRolesPremissionJsonString.Contains),
                 GetIdentityroles);
        }

        private List<string> GetIdentityroles()
        {
            return IdentityManager.GetCurrentIdentityRoles();
        }

    }

ex message:

Test method VarinaCmsV2.Data.Tests.AppDbContextPRoxyTests.ShouldFilterBaseOnRestrictedAccses threw exception:
System.Data.Entity.Core.EntityCommandCompilationException: An error occurred while preparing the command definition. See the inner exception for details. ---> System.ArgumentException: DbExpressionBinding requires an input expression with a collection ResultType.
Parameter name: input
    at System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder.DbExpressionBuilder.BindAs(DbExpression input, String varName)
   at System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder.DbExpressionBuilder.Bind(DbExpression input)
   at EntityFramework.DynamicFilters.LambdaToDbExpressionVisitor.MapAnyOrAllExpression(MethodCallExpression node)
   at EntityFramework.DynamicFilters.LambdaToDbExpressionVisitor.VisitMethodCall(MethodCallExpression node)
   at System.Linq.Expressions.MethodCallExpression.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
   at System.Linq.Expressions.ExpressionVisitor.VisitBinary(BinaryExpression node)
   at EntityFramework.DynamicFilters.LambdaToDbExpressionVisitor.VisitBinary(BinaryExpression node)
   at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
   at System.Linq.Expressions.ExpressionVisitor.VisitLambda[T](Expression`1 node)
   at System.Linq.Expressions.Expression`1.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
   at EntityFramework.DynamicFilters.LambdaToDbExpressionVisitor.Convert(DynamicFilterDefinition filter, DbExpressionBinding binding, DbContext dbContext, DataSpace dataSpace)
   at EntityFramework.DynamicFilters.DynamicFilterQueryVisitorCSpace.BuildFilterExpressionWithDynamicFilters(IEnumerable`1 filterList, DbExpressionBinding binding, DbExpression predicate)
   at EntityFramework.DynamicFilters.DynamicFilterQueryVisitorCSpace.Visit(DbScanExpression expression)
   at System.Data.Entity.Core.Common.CommandTrees.DbScanExpression.Accept[TResultType](DbExpressionVisitor`1 visitor)
   at System.Data.Entity.Core.Common.CommandTrees.DefaultExpressionVisitor.VisitExpression(DbExpression expression)
   at System.Data.Entity.Core.Common.CommandTrees.DefaultExpressionVisitor.VisitExpressionBinding(DbExpressionBinding binding)
   at System.Data.Entity.Core.Common.CommandTrees.DefaultExpressionVisitor.VisitExpressionBindingEnterScope(DbExpressionBinding binding)
   at System.Data.Entity.Core.Common.CommandTrees.DefaultExpressionVisitor.Visit(DbProjectExpression expression)
   at EntityFramework.DynamicFilters.DynamicFilterQueryVisitorCSpace.Visit(DbProjectExpression expression)
   at System.Data.Entity.Core.Common.CommandTrees.DbProjectExpression.Accept[TResultType](DbExpressionVisitor`1 visitor)
   at EntityFramework.DynamicFilters.DynamicFilterInterceptor.TreeCreated(DbCommandTreeInterceptionContext interceptionContext)
   at System.Data.Entity.Infrastructure.Interception.DbCommandTreeDispatcher.<Created>b__0(IDbCommandTreeInterceptor i, DbCommandTreeInterceptionContext c)
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TInterceptionContext,TResult](TResult result, TInterceptionContext interceptionContext, Action`2 intercept)
   at System.Data.Entity.Infrastructure.Interception.DbCommandTreeDispatcher.Created(DbCommandTree commandTree, DbInterceptionContext interceptionContext)
   at System.Data.Entity.Core.Common.DbProviderServices.CreateCommandDefinition(DbCommandTree commandTree, DbInterceptionContext interceptionContext)
   at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlanFactory.CreateCommandDefinition(ObjectContext context, DbQueryCommandTree tree)
 --- End of inner exception stack trace ---
    at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlanFactory.CreateCommandDefinition(ObjectContext context, DbQueryCommandTree tree)
   at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlanFactory.Prepare(ObjectContext context, DbQueryCommandTree tree, Type elementType, MergeOption mergeOption, Boolean streaming, Span span, IEnumerable`1 compiledQueryParameters, AliasGenerator aliasGenerator)
   at System.Data.Entity.Core.Objects.EntitySqlQueryState.GetExecutionPlan(Nullable`1 forMergeOption)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__6()
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
   at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at VarinaCmsV2.Data.Tests.AppDbContextPRoxyTests.ShouldFilterBaseOnRestrictedAccses() in E:\programming\projects\Source\VarinaCmsV2\VarinaCmsV2.Data.Tests\AppDbContextPRoxyTests.cs:line 39

and thank u alot for last answer

First of all, I'm not sure what the GlobalFilter class or ApplyFilter method are.  So I'm going to assume GlobalFilter is derived from DbContext and the ApplyFilter method is called from inside the OnModelCreating() method.
I also don't know the type of the 'AllowedRolesPremissionJsonString' property.  From the name of it, it sounds like it's a string.  But you are referencing a ".Contains" property.  If it is a string, then that will be a problem since you are passing a reference to the Contains method when the .Any() is going to be expecting a string.
Also, you can't access a private method to retrieve the value for the "roles" parameter.  When the expression value is needed, it will fail to evaluate that because it will not have a reference to the "GlobalFilters" instance.  The proper way to handle that is to reference your DbContext derived class as described here: https://github.com/jcachat/EntityFramework.DynamicFilters#parameter-expressions.
So based on my assumptions above, I THINK your filter should look like this:
modelBuilder.Filter("RestrictItemsBaseOnAccsess",
                (IAccessRestrictedItem x, List<string> roles) => x.AccessType == AccessType.Public
                         || roles.Any(r => r == x.AllowedRolesPremissionJsonString),
                 (GlobalFilter ctx) => ctx.IdentityManager.GetCurrentIdentityRoles());

GlobalFilter is a base class that  i will inject a list from it to my dbcontext from its constructor

 public class AppDbContext : IdentityDbContext<User, Role, Guid, UserLogin, UserRole, UserClaim>, IUnitOfWork
    {
        private readonly List<GlobalFilter> _globalFilters;
        public AppDbContext(List<GlobalFilter> globalFilters = null) : base("name=DefaultConnection")
        {
            _globalFilters = globalFilters;
           Database.SetInitializer(new MigrateDatabaseToLatestVersion<AppDbContext, Configuration>());

        }
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Add<MapProtectedFieldConvention>();
            modelBuilder.Configurations.AddFromAssembly(typeof(User).Assembly);
            modelBuilder.Ignore<BaseEntity>();
            FindAndRegisterEntitiesFromAssembly(typeof(BaseEntity).Assembly, typeof(DbEntity), modelBuilder);
            _globalFilters?.ForEach(x => x.ApplyFilter(modelBuilder));
            base.OnModelCreating(modelBuilder);
        }
    }

And any drived class applies its own logic
and AllowedRolesPremissionJsonString property is a string field that stores json data like this
  public ObservableCollection<RolePremission> AllowedRolesPermissions
        {
            get
            {
                var additionalPermissions =
                       JsonConvert.DeserializeObject<ObservableCollection<RolePremission>>(AllowedRolesPremissionJsonString ?? string.Empty)
                       ?? new ObservableCollection<RolePremission>();
                additionalPermissions.CollectionChanged += SaveToPremissinBackingField;
                return additionalPermissions;
            }
            set { AllowedRolesPremissionJsonString = JsonConvert.SerializeObject(value); }
        }
        private void SaveToPremissinBackingField(object sender, NotifyCollectionChangedEventArgs e)
        {
            var premissions = sender as ObservableCollection<RolePremission>;
            if (premissions == null) throw new InvalidOperationException("Cant Observe Entitiy AllowedPremissions For DataPresistence");
            this.AllowedRolesPermissions = premissions;
        }

any way i need a way to decouple my db context from system requirement logics

 modelBuilder.Filter("RestrictItemsBaseOnAccsess",
                (IAccessRestrictedItem x, List<string> roles) => x.AccessType == AccessType.Public
                         || roles.Any(r=>r== x.AllowedRolesPremissionJsonString),
              (AppDbContext ctx)=> ctx.CurrentUserRoles);

i wrote this for sake of testing  but the same problem exists :
DbExpressionBinding requires an input expression with a collection ResultType.

yooohoooooo any idea ??

I don't know what's wrong with the .Any() clause.  That is supported.  Look in the unit tests at the ChildCollectionFiltersTests.cs.  There are a couple of tests there for .Any().  Maybe experiment with those and try to plug in your specific entities (as much as possible) to see if you can reproduce it there.
string.Contains() is not supported at the moment.  That only works on an IEnumerable.  That is something I can fix but that will only fix your .Contains("Hello") attempt.
Also, I think I see what you were trying to do in your original filter.  Where you have this clause:
roles.Any(x.AllowedRolesPremissionJsonString.Contains)

I don't think that syntax can be supported and might be why it's complaining about needing a collection result type.
But once I add support for stirng.Contains() in the filter linq, this might work:
roles.Any(r => x.AllowedRolesPremissionJsonString.Contains(r))

I'll try to get that done in the next day or 2.

I just pushed out an update (v 2.10.0) that adds support for string.Contains().
But, after another look, I don't think this is going to work at all.  If you create the filter like this:
roles.Any(r => x.AllowedRolesPremissionJsonString.Contains(r))

that will create a subquery that attempts to evaluate this portion of that query:
r => x.AllowedRolesPremissionJsonString.Contains(r)

The problem there is that it's accessing the outer table ('x' in the linq query) which would not be valid sql since the inner sql query will not have any reference to the outer "x" entity set.
I also don't know if a valid query can be created against the parameter "roles" - it may only work on an entity collection.

Can you add support for filter with claim


Oracle分页查询下一页时出现语法解析错误  com.alibaba.druid.sql.parser.ParserException: syntax error, expect FIRST, actual NEXT, pos 1173, line 1, column 1169, token NEXT

运行语句是：SELECT
specialact0_. ID AS id1_14_,
specialact0_.gmt_create AS gmt_create2_14_,
specialact0_.gmt_modified AS gmt_modified3_14_,
specialact0_.issuer AS issuer4_14_,
specialact0_.prisonarea AS prisonarea5_14_,
specialact0_.prisonarea_code AS prisonarea_code6_14_,
specialact0_. NAME AS name7_14_,
specialact0_.prison AS prison8_14_,
specialact0_.synopsis AS synopsis9_14_,
specialact0_.sys_orgcode AS sys_orgcode10_14_,
specialact0_.sys_orgname AS sys_orgname11_14_,
specialact0_.sys_permname AS sys_permname12_14_,
specialact0_.sys_perrmcode AS sys_perrmcode13_14_,
specialact0_. TIMES AS times14_14_
FROM
hs_special_activities specialact0_
WHERE
1 = 1 offset ? ROWS FETCH NEXT ? ROWS ONLY

请问你解决了吗，我也遇到相同的问题

https://github.com/alibaba/druid/releases/tag/1.1.10
问题修复，请用新版本


GAAD 1 year later blog post 5/20

To be released on May 20th
This Pull request is for the one year anniversary of React Native taking the GAAD pledge to reflect on the progress made towards a more accessible React Native.
All feedback is welcome!

It look's like Greg's blog post is up! https://tech.fb.com/react-native-accessibility/

I'm planning to merge this in at 9am CA time!


vs nothing

Describe your bug here.
tried running the killshot mod on 1.0 pre-release
it was still playable but there was nothing,just a black screen
Crash Log or logcat logs (if existing)
No response
Are you modding a build from source or with Lua?
Lua
What is your build target?
Android
Which psych engine version you're on?
1.0 (Prerelease)
Did you edit anything in this build? If so, mention or summarize your changes.
no.

this feels more like a you problem if anything

and a problem with the mod

SScript died and SM switched to hscript-iris that still wip so


Consider designMode and contentEditable

For now, I'll use textareas for my tests.
This will be useful, though.

Interesting. Having a test would be great! Also, putting the return statement on its own line would be good too.

Would be much nicer to work on this after #21 is fixed.

The tests should test that:
The methods

#dispatchEventsForInput

#dispatchEventsForAction

#dispatchEventsForKeystroke

Do not fire events when the element is not editable. Perhaps there is a module for that? Anyway, there should be.

Do fire events when the element is editable.

I'm not sure what to do about this one. Are you going to update the PR?

Sure am.

@eventualbuddha this should serve most use cases. The new dependency is a new module I wrote just for this. It seems to me to be sufficiently tested so I don't think we require any additional tests here about that functionality. What do you think?

@eventualbuddha ready for review.

@eventualbuddha I need you to press the big green button please, Brian.

Do not press the big green button, please! Please merge #29 before this and I'll have some more work to do on this one. Just a little.

Hi @eventualbuddha can we get this merged in? I need to support contenteditable for my project as well.
The tool is super useful otherwise. Thanks!

For anyone who finds it helpful in the meantime, here's the quick hack I put in our tests to make this work:
function fixUpKeyboard(keyboard) {
    const proto = Object.getPrototypeOf(keyboard);
    if (keyboard.targetCanReceiveTextInput === proto.targetCanReceiveTextInput) {
        const oldHandler = keyboard.targetCanReceiveTextInput;

        keyboard.targetCanReceiveTextInput = (target) => {
            let allowed = false;
            if (oldHandler.call(keyboard, target)) {
                allowed = true;
            }
            else if (target && target.getAttribute(`contenteditable`) === `true`) {
                allowed = true;
            }
            return allowed;
        };
    }
    return keyboard;
}

This should be fixed by the next release that includes #37 (should be v1.4.0).

I can confirm that 2.0 fixes this.


Update release wrapper

@bot-gradle merge

I've triggered a build for you. Click here to see all failures if there's any.


non binary rules for statement templates

I wonder if it's worth adding the following to the potential values of statement:

recommended - the LRP is recommended to use this statement property but the LRC cannot expect it to be always included.
optional - the LRC might want to look out for this property and use it if included, but there's no expectation on the LRP to provide it.

Hmm, not sure. I'd love to see some more specific examples to help flesh out the amount this would actually help.

The video recipe says "Video Activity Definition includes the following: ... If available include the length of the video in 'extensions' using: http://id.tincanapi.com/extension/duration" That would be a recommended property.
The Open badges recipe also has recommended properties.
I have less concrete examples for the 'optional' tag, but you could imagine a type of activity that is sometimes scored and sometimes not scored including score as an optional property in statements.

Re: optional, all properties are sort of optional by default unless included or excluded
I think most of the roles of recommendation (which will always mostly be about extensions, since ppl writing templates already are fully informed about the non-extension structure of statements) are well-filled by putting activity types and verbs and such in the extension definition, which'll have the benefit of being "recommendation-y" for other uses of those entities.
For your video example, the video activity type would listed for the duration extension. And for open badges, all the extensions would list the open badge activity type.
The video example does illustrate a need to comment on concepts defined in other profiles, though, which has usually been left out. I'll play around with some syntax for that.

My understanding of what you're suggesting is that we'd list the statements the extensions are intended to be used in within the human readable definition property of extensions. Did I understand that right?
There's two problems with that:

It's not machine readable so the LRC has no way of automatically determining it should be looking for these extensions.
What if the profile author wants to include an extension in a statement that's not defined in that profile?

Is there any specific downside to including optional and recommended flags in statement templates?
Regarding optional, yes all properties are optional, but including optional properties in a template tells the LRC to specifically look for those properties because while they won't always be present, they's a good chance of them being there some of the time.


How to render data with math ml

I had a string from a database like this
<math xmlns="http://www.w3.org/1998/Math/MathML"><mfenced><mtable><mtr><mtd><mn>3</mn></mtd><mtd><mn>5</mn></mtd></mtr><mtr><mtd><mo>-</mo><mn>1</mn></mtd><mtd><mn>2</mn></mtd></mtr></mtable></mfenced><mfenced><mtable><mtr><mtd><mn>2</mn></mtd><mtd><mo>-</mo><mn>2</mn></mtd></mtr><mtr><mtd><mn>5</mn></mtd><mtd><mn>1</mn></mtd></mtr></mtable></mfenced></math>
I tried using cdn and
window.Mathjax.Hub.Queue(['Typeset', window.Mathjax.Hub]);
It's still not working rn

There is not enough information here to diagnose your problem.  MathJax can process the MathML that you gave, so it is probably in your setup or workflow, but you don't indicate which.  For example, you don't say what your configuration is, so I can't tell if you actually have the MathML input jax loaded or not.  You don't say how you insert the MathML into the page, and where the MathJax.Hub.Queue() call is in relation to that.  You don't say what browser or OS you are using, or what web platform you are using (or if you have written your own).  So there is not much we can say to help you at this point.
A link to a minimal (non-)working example page would be most useful.  Otherwise, additional details would help.

I just found the solution using react-mathjax-preview library, thanks for the answer


Remove mcrypt as a requirement

Installing using composer, I get slim/slim suggests installing ext-mcrypt (Required for HTTP cookie encryption). How can this be, if mcrypt was removed?

It is still present in composer.json in the 2.x branch: https://github.com/slimphp/Slim/blob/2.x/composer.json

It is not a requirement. It is suggestion. Ie. you can install ext-mcrypt if wanted but it is not required.


Circular $ref pointer not supported

Describe the bug
A clear and concise description of what the bug is.
Pointing prism to a file that contains components that use recursive field definition, Prism fails with the message:

Circular $ref pointer found at /tmp/test.yaml#/components/schemas/Person/properties/spouse

To Reproduce
A minimal API definition triggering the error message:
info:
  title: "Circular reference example"
  description: "Exemplifies a schema with circular references"
  version: 0.1.0

paths:
  /directory:
    get:
      responses:
        "200":
          description: "The request was successfully processed"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Person"
              example:
                name: John
                spouse:
                  name: Cynthia

components:

  schemas:

    Person:
      nullable: true
      properties:
        name:
          type: string
          nullable: false
        spouse:
          $ref: "#/components/schemas/Person"

Expected behavior
As the OAS file specifies a valid API, the server should be able to mock that API.
While having a circular reference can theoretically lead to a infinite recursion, this can be in practice avoided by having a nullable reference to the child object.
Environment

Prism version: [4.1.0]

I just experienced the same problem trying Prism on a real-life contract running in production. I've found https://github.com/stoplightio/prism/issues/891 and https://github.com/stoplightio/prism/pull/1271 for more context. Can't really remove the circular reference as it's how the data is :-/ and really want to give Prism a go!

Hey people,
Essentially the reason why we decided to disable the circular reference support is because no matter how much we can support them, we will always ultimately fail to serialise a circular response body and we haven't been able to come up with a proper story to handle such. Consider this example:
    Person:
      properties:
        name:
          type: string
        spouse:
          $ref: "#/components/schemas/Person"

There is no way a data structure like this can go over the wire. Both the serialisation (input) and deserialisation (output) is not possible.
While the serialisation is not a problem from a Prism perspective, the deserialisation is (as in — Prism cannot produce such output).
We also have some other edge corner cases we did not have the time to investigate. It seems to be kinda important for you, so we'll see if I can find some time to look into this and…relax this hard constraint a bit.
Cheers!

@XVincentX thanks for your reply :)
If I can add: in the provided example, in practice would become Person (A) -> Spouse -> Person (B) -> Spouse -> Person (A) (can be a copy object, not memory reference to the previously defined one) - maybe there could be an option to resolve an arbitrary number of recursive levels and then give up (with the difference that this number could be overridden in the config)?
After all, the contract doesn't specify how deep the circular reference needs to be (therefore one level would always be enough to match the contract?).

If I can add: in the provided example, in practice would become Person (A) -> Spouse -> Person (B) -> Spouse -> Person (A)

That is  anecdotical. spouse was just a name I come up with, it might not be the same and the chain could be infinite (impossibility to serialise the payload)

there could be an option to resolve an arbitrary number of recursive levels and then give up

That would be a tradeoff, although this would be essentially like forcing a nullable: true after a certain depth; that will make the output validator fail, making Prism scream at you (and you regretting your life choices)

After all, the contract doesn't specify how deep the circular reference needs to be

I think that is inaccurate. The example I wrote clearly specifies an infinite circular chain — I do not see any doubt about it.

@XVincentX , thanks for replying so promptly.
While I understand why it is not possible to serialize A -> B -> A, I do not get what the problem would be in serializing A -> B where both A and B are instances of the same type.
The example I chose might bee poor in that it indeed also allows logical recursiveness that

Hi,
I just faced the same issue today. I can understand that dynamically mocking and serializing a circular reference causes an issue. In my case though, the open api file provides a response example and prism would never have to do such a thing.
Nonetheless, just describing the circular reference in the OpenApi specification file prevent prism from booting :/ Is there any way to work around this ?

Not at the moment; however I can see there's a lot of pressure here so I'll probably circle back on this and see if we can improve the situation somehow

FYI, the Kubernetes OpenAPI spec contains circular references.
Mocking the API server with Prism would help testing operators and other tools interacting with the Kubernetes API Server.
Looking forward to it!

@linkdd could you narrow it down a bit? Haha can't go digging through all that! :)
@blemasle I don't understand this JSON:
{"name":"John","spouse":{"name":"Cynthia","spouse":null}}

This looks like John is married to Cynthia but Cynthia is not married to John.
Poor John.
This doesn't make any sense fundamentally so it's going to lead to confusing conversations trying to use it as an example.
If you wanted a null in there, then sure your OpenAPI should be this:
    Person:
      properties:
        name:
          type: string
        spouse:
          oneOf:
            - $ref: "#/components/schemas/Person"
            - nullable: true

Supporting this in Prism would just be a case of picking oneOf's at random, which I remember discussing in the past. Some people want oneOfs to always show the first, which is where you'd get into trouble, because again the chain would never be broken by a null.
Possibly a more logical example would be parent.
Person:
  properties:
    name:
      type: string
    manager:
      oneOf:
        - $ref: "#/components/schemas/Person"
        - nullable: true

This is another chain which is not infinite but could be. It makes me wonder why people design APIs like this because clients should be able to follow a link if they want that information instead of having recursion thrust upon them.
{
  "name":"John",
  "manager": {
    "name":"Cynthia",
    "manger":{
      "name":"Frank",
      "manger":{
        "name":"Mary",
        "manger":{
          "name":"George",
          "manger":{
            "name":"Big BOSS CEO",
            "manger":null
          }
        }
      }
    }
  }
}

If you're using Prism you're probably designing an API right now, and if you're doing that its not too late to change the design. Use any Hypermedia Format and insert links, which might look as simple as this:
{
  "name":"John",
  "links": {
    "manager":"https://api.example.com/people/cynthia"
  }
}

Prism is happy. Your API is happy. Your clients are happy.
If anyone has any other examples of circular references which should exist, lmk, and in the men time @XVincentX can we look into that oneOf shortcut with null? We can't do anything about any of these other situations so far but we can t least handle that.

@philsturgeon Here is the error I get:
$ prism mock https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json
[18:15:53] » [CLI] ...  awaiting  Starting Prism…
[18:15:56] » [CLI] ×  fatal     Circular $ref pointer found at https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json#/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps/properties
prism mock <document>

Start a mock server with the given document file

Arguments positionnels :
  document  Path to a document file. Can be both a file or a fetchable resource on the web.      [chaîne de caractères] [requis]
Options :
      --version       Affiche le numéro de version                                                                     [booléen]      --help          Affiche l'aide                                                                                [booléen]  -p, --port          Port that Prism will run on.                                             [nombre] [requis] [défaut : 4010]  -h, --host          Host that Prism will listen to.                     [chaîne de caractères] [requis] [défaut : "<IP_ADDRESS>"]      --cors          Enables CORS headers.                                                            [booléen] [défaut : true]  -m, --multiprocess  Forks the http server from the CLI for faster log processing.                   [booléen] [défaut : false]      --errors        Specifies whether request/response violations marked as errors will produce an error response
                                                                                [booléen] [requis] [défaut : false]  -d, --dynamic       Dynamically generate examples.                                                  [booléen] [défaut : false]
{
  stack: 'ReferenceError: Circular $ref pointer found at https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json#/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps/properties\n' +
    '    at foundCircularReference (C:\\Users\\david\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\@apidevtools\\json-schema-ref-parser\\lib\\dereference.js:159:15)\n' +
    '    at crawl (C:\\Users\\david\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\@apidevtools\\json-schema-ref-parser\\lib\\dereference.js:75:24)\n' +
    '    at dereference$Ref (C:\\Users\\david\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\@apidevtools\\json-schema-ref-parser\\lib\\dereference.js:125:24)\n' +
    '    at crawl (C:\\Users\\david\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\@apidevtools\\json-schema-ref-parser\\lib\\dereference.js:58:26)\n' +
    '    at crawl (C:\\Users\\david\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\@apidevtools\\json-schema-ref-parser\\lib\\dereference.js:67:28)\n' +
    '    at crawl (C:\\Users\\david\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\@apidevtools\\json-schema-ref-parser\\lib\\dereference.js:67:28)\n' +
    '    at dereference$Ref (C:\\Users\\david\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\@apidevtools\\json-schema-ref-parser\\lib\\dereference.js:125:24)\n' +
    '    at crawl (C:\\Users\\david\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\@apidevtools\\json-schema-ref-parser\\lib\\dereference.js:58:26)\n' +
    '    at crawl (C:\\Users\\david\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\@apidevtools\\json-schema-ref-parser\\lib\\dereference.js:67:28)',
  message: 'Circular $ref pointer found at https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json#/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps/properties',
  toJSON: [Function: toJSON],
  name: 'ReferenceError',
  toString: [Function: toString]
}

The culprit is at this path #/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps/properties
I invite you to run this command to have the full schema:
$ wget https://raw.githubusercontent.com/kubernetes/kubernetes/master/api/openapi-spec/swagger.json
$ cat swagger.json | jq '.definitions["io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps"].properties'

This definition is used within the CustomResourceDefinition resource schema, which allows the developer to provide an OpenAPI schema of their custom resource for validation by the Kubernetes API Server. Hence the circular reference.
I bet it's very difficult to generate an OpenAPI schema from nothing in order to mock this endpoint 😆
A solution would be to provide the user some option on what to do when detecting a circular reference:

throw an error (the default, for backward compatibility)
return some static data provided by the user
some other user-provided mechanism ?

Let me know if I can be of any help on that subject.

@philsturgeon Wrong mention here. I'm not the author of the spouse example :)

Ok, here's something we could try.
Other than nullable (or type: null in v3.1 🥳) there's another way we can conceptually forceably short-circuit an infinite loop like this.
If a property is not in the required: [manager] array, we can conceptually just not show it.
How to decide if we show it or not? Well, we can probably pattern match by looking at the ancestors. A B A ok fine. A B A B probably bad.
The trouble here is when you get to a few levels of this sort of nonsense. A B C A B C that's already quite big and fits inside the "dont repeat yourself a third time". A B C A B C A B C would trigger the short circuit but would probably blow a fuse already depending on big those resources are.
Anyway, perhaps we can take a swing at something along these lines, by shimming something up around json-schema-ref-resolver to see if we can add this tracking, and if it works maybe we can bake it into the tool as a "hook to fire when you hit a circular loop" type exception thrower. Whatever, that's for later.
If we can find a way to get the code working, it would theoretically work for "belongs to" (manager > manager > manager), and can work for nested has one nested has one.... business > website > business > website...

Yep! Thanks Dionis. @XVincentX will get on top of this soon, we have an approach that can help solve some more of these circular references, remember we’ve fixed several but not all circular defences are equal.

Hey @dargiri,
I've explained why the functionality was disabled in https://github.com/stoplightio/prism/issues/1456#issuecomment-702176386
TL;DR: it's not easy to know where we can handle circular references successfully and where not.
Rather than trying to do something according to common sense, ship something for the sake of and then get tons of issues with edge cases or one scenario making another one not work correctly — I decided it was a better idea to admit we do not have a story flashed out yet and, as long we don't have it, I am not going to let it happen.
If this takes the priority, more than happy to work seriously on this.

I'd also like to voice my support for finding some kind of solution.  I can appreciate that it's really challenging to solve all the edge cases but, frankly, your stance on this issue seems pretty hard-lined.  I myself have a terribly simple use case which is just modeling a nested structure of objects, which is never going to be circular in practice but I am prevented from even starting the mock server.  Being a long-time Java user I'm perfectly used to seeing the StackOverflowException when I'm doing something silly and trying to serialize a true circular reference.  I would love to see prism do the same thing:  let the users shoot themselves in the foot if that's what they're determined to do.
Love the tool everyone, best regards!
In case it's relevant, here is the trimmed down example of the spec file I'm working with:
openapi: 3.0.1
info:
  title: Example Case
  description: Nested $refs to same schema
  version: 1.0.0
servers:
  - url: 'http://localhost:8080'

paths:
  /report:
    get:
      operationId: getReportContent
      summary: 'Report Content'
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportContent'

components:
  schemas:
    ReportContent:
      description: 'The detailed content of a given report'
      type: object
      properties:
        title:
          description: 'The title of the report'
          type: string
        sections:
          description: 'The sections that contain the content for the body of the report.'
          type: array
          items:
            $ref: '#/components/schemas/ReportSection'

    ReportSection:
      description: 'A logical grouping of content within the report'
      type: object
      properties:
        title:
          description: 'The title of the section'
          type: string
        content:
          description: 'The textual content of the section'
          type: string
        childSections:
          description: 'Sections can be nested inside one another for building a hierarchical report structure'
          type: array
          items:
            $ref: '#/components/schemas/ReportSection'
      required:
        - title
        - content

I’ve suggested some approaches we could try to solve a few more scenarios involving circular references, and we’ll get to them when we can. In the mean time if anyone would like to send a pull request that would be very welcome. Happy holidays folks!

Hi @philsturgeon
Just wanted to reiterate one more time what I already mentioned here: https://github.com/stoplightio/prism/issues/1456#issuecomment-704009063
My spouse example is not the best example for this issue, as it semantically entails a circular dependency (A -> B -> A).
Yet in the real world there are many instances where parent and children will have the same type but will not be referencing each other.
You pointed out the manager example, other people in this thread suggested more examples along the same line.
What we're pointing out in this thread is that it should be possible for Prism to generate data for a schema where a parent object references an object of the same type.
That is a valid schema, therefore one would expect you can generate data for it.
If you think the spouse example creates confusion, I'm happy to start a new ticket with an example you find more suitable.

Thanks @marcoboi. As I said I think we have some examples that work and we can take a swing as solving a few more types of circular reference in the new year.

Reading over the related issues, most of the conversation seems to be focused on the difficulties of serializing responses for the mock server. I'm curious about the status of circular refs in the validation proxy. Any pointers?

@andrewsomething We do not have any update on this unfortunately. We're working on other stuff and I am not in a position of giving you an ETA on when we'll tame this.

@andrewsomething We do not have any update on this unfortunately. We're working on other stuff and I am not in a position of giving you an ETA on when we'll tame this.

@XVincentX I don't think @andrewsomething was chasing for an update, just asking for insight into how circular references work in the validation proxy.
@andrewsomething Hello! Validation and response generation are two very different concepts. Trying to create JSON based on schemas which have self-referencing relationships and knowing when to stop trying to create more JSON in that infinite loop is the main problem discussed in this thread. Looking at an instance of JSON and figuring out if it's valid against the schema is waaaaaaay easier.
I'd recommend giving it a try and see if you have any problems. If you do, let us know. If not, enjoy!

@XVincentX I don't think @andrewsomething was chasing for an update, just asking for insight into how circular references work in the validation proxy.
@andrewsomething Hello! Validation and response generation are two very different concepts. Trying to create JSON based on schemas which have self-referencing relationships and knowing when to stop trying to create more JSON in that infinite loop is the main problem discussed in this thread. Looking at an instance of JSON and figuring out if it's valid against the schema is waaaaaaay easier.
I'd recommend giving it a try and see if you have any problems. If you do, let us know. If not, enjoy!

As the docs read:

Even though Prism is technically able to internally handle circular references, the CLI will refuse to mock the provided document in case any circular reference is detected.

I had naively hoped that something like this is all it would take to use them with the proxy server: https://github.com/stoplightio/prism/compare/master...andrewsomething:enable-circular-proxy While Prism doesn't fall over proxying an API w/ a circular ref, the schema for the operation seems make it through the transformation to HTTP Spec. So requests can be made and response are passed through, they are not actually validated for operations w/ a circular ref.

As the docs read:

Even though Prism is technically able to internally handle circular references, the CLI will refuse to mock the provided document in case any circular reference is detected.

I had naively hoped that something like this is all it would take to use them with the proxy server: https://github.com/stoplightio/prism/compare/master...andrewsomething:enable-circular-proxy While Prism doesn't fall over proxying an API w/ a circular ref, the schema for the operation seems make it through the transformation to HTTP Spec. So requests can be made and response are passed through, they are not actually validated for operations w/ a circular ref.

The Swagger parser's bundle method is alleged to produce a Swagger object and also "eliminate the risk of circular references".

Is that good enough for prism?
Does dereference do something bundle does not, which prism depends on?

diff --git a/packages/cli/src/operations.ts b/packages/cli/src/operations.ts
index 8bb49ad..1199fe5 100644
--- a/packages/cli/src/operations.ts
+++ b/packages/cli/src/operations.ts
@@ -9,7 +9,7 @@ import type { OpenAPIObject } from 'openapi3-ts';
 import type { CollectionDefinition } from 'postman-collection';

 export async function getHttpOperationsFromSpec(specFilePathOrObject: string | object): Promise<IHttpOperation[]> {
-  const result = await dereference(specFilePathOrObject, { dereference: { circular: false } });
+  const result = await bundle(specFilePathOrObject, { dereference: { circular: false } });

   if (isOpenAPI2(result)) return transformOas2Operations(result);
   if (isOpenAPI3(result)) return transformOas3Operations(result);

The Swagger parser's bundle method is alleged to produce a Swagger object and also "eliminate the risk of circular references".

Is that good enough for prism?
Does dereference do something bundle does not, which prism depends on?

diff --git a/packages/cli/src/operations.ts b/packages/cli/src/operations.ts
index 8bb49ad..1199fe5 100644
--- a/packages/cli/src/operations.ts
+++ b/packages/cli/src/operations.ts
@@ -9,7 +9,7 @@ import type { OpenAPIObject } from 'openapi3-ts';
 import type { CollectionDefinition } from 'postman-collection';

 export async function getHttpOperationsFromSpec(specFilePathOrObject: string | object): Promise<IHttpOperation[]> {
-  const result = await dereference(specFilePathOrObject, { dereference: { circular: false } });
+  const result = await bundle(specFilePathOrObject, { dereference: { circular: false } });

   if (isOpenAPI2(result)) return transformOas2Operations(result);
   if (isOpenAPI3(result)) return transformOas3Operations(result);

Hey Everyone,
Finally got some time to work on circular ref support in prism, if you update prism to the latest, circular refs should be supported. Please create a new issue if something is not working as expected!


Internationalization, localization

The app could handle multiple locales (this is mostly relevant to the settings modal and the approximate timer). The Day.js integration could make this a bit more difficult.

It would be cool to integrate with similar services like Crowdin.

Absolutely! I've already created and set up a project on Crowdin, I'll share it in the repo soon.


Fix rust verifier to correctly verify the code being run

Currently https://github.com/risc0/risc0/blob/main/risc0/zkvm/verify/src/circuit.rs is missing the code required to verify which method is being run (which the C++ has).

Users may see this error in the log:

new_game: JsValue(Error: {"index":0,"kind":{"ExecutionError":"Smart contract panicked: panicked at 'called Result::unwrap() on an Err value: Io(Kind(UnexpectedEof))', src/lib.rs:49:62"}} TypedError@https://cdn.jsdelivr.net/npm/near-api-js@0.41.0/dist/near-api-js.js:3269:9 ServerError@https://cdn.jsdelivr.net/npm/near-api-js@0.41.0/dist/near-api-js.js:3595:1 ServerTransactionError@https://cdn.jsdelivr.net/npm/near-api-js@0.41.0/dist/near-api-js.js:3598:1 parseResultError@https://cdn.jsdelivr.net/npm/near-api-js@0.41.0/dist/near-api-js.js:3611:29 signAndSendTransactionV2@https://cdn.jsdelivr.net/npm/near-api-js@0.41.0/dist/near-api-js.js:163:36 )


Unable to run on KITTI

I have everything working fine in the ShapeNet dataset, but if I switch to KITTI it doesn't work. I have followed the steps to install dependencies and modify config.py.
python3 runner.py --test --weights=/home/skewen/GRNet/GRNet-KITTI.pth
Traceback (most recent call last):   File "runner.py", line 76, in <module>     main()   File "runner.py", line 65, in main     test_net(cfg)   File "/home/skewen/GRNet/core/test.py", line 71, in test_net     sparse_loss = chamfer_dist(sparse_ptcloud, data['gtcloud']) KeyError: 'gtcloud'

The KITTI does not support test due to the GT is missing for the dataset.
You can generate the completed point clouds with the following command
python3 runner.py --inference --weights=/home/skewen/GRNet/GRNet-KITTI.pth


Slider Input

Use case:
Slider for different time periods: 12 months, 24 months, 36 months

fixed with https://github.com/evidence-dev/evidence/pull/2035


tests: Temporarily remove shader test

CI Vulkan-ExtensionLayer build queued with queue ID 22503.

CI Vulkan-ExtensionLayer build # 525 running.

CI Vulkan-ExtensionLayer build # 525 passed.

My understanding is that this is blocking a packaging process change, so I'm going to merge it.
@ziga-lunarg it would be nice if you can retroactively provide some details why this is needed when you are available again.

CI Vulkan-ExtensionLayer build queued with queue ID 22619.

CI Vulkan-ExtensionLayer build queued with queue ID 22638.

Note to self: The 'Update Branch' button never does the right thing. 🤦

CI Vulkan-ExtensionLayer build # 527 running.

CI Vulkan-ExtensionLayer build # 527 passed.


CIP-???? | Universal JSON Encoding for Domain Types

This is a CIP corresponding to CPS-11.
It includes a json-schema file specifying JSON layout for Babbage-era Cardano domain types.
The markdown file contains motivation for encoding choices and proposed conventions for building schemas for future eras.
(Rendered version)

Awesome

@klntsky it would be good if you can come to the next CIP meeting (https://hackmd.io/@cip-editors/83) where I've added this for Triage on the agenda & we can digest the current feedback there & probably assign a number.

Might it better to prepare schemas for Conway cddl ? Because it might that the proposed CIP will be approved when Babbage is will be already outdated


[FEAT] UI Update, the current size of canvas is too small

Problem
The current canvas size is too small, not allowing the application canvas to be used to its full potential.
Solution
Increase the canvas size to fill in the entire screen. The buttons and color picker can be overlaid on top of it.
Alternate solution
Increase the canvas size to fill in just enough of the screen, push the UI elements aside and allow the canvas to be scaled as per user requirement. Adding scrollbars

REQUEST: I'd like to be assigned to this, if the feature seems plausible

@thatsyogeshjjr Duplicate issue of #37


Document Update

Change in keyword from "Possibles" to "Possible"
[ ] Make sure there is a JIRA issue filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
[ ] Each commit in the pull request should have a meaningful subject line and body.
[ ] If you're unsure, you can format the pull request title like [CAMEL-XXX] Fixes bug in camel-file component, where you replace CAMEL-XXX with the appropriate JIRA issue.
[ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
[ ] Run mvn clean install -Psourcecheck in your module with source check enabled to make sure basic checks pass and there are no checkstyle violations. A more thorough check will be performed on your pull request automatically.
Below are the contribution guidelines:
https://github.com/apache/camel/blob/master/CONTRIBUTING.md

I have done the changes in javadoc and created a PR
https://github.com/apache/camel/pull/4229
Shall i close this request ?

This can be closed, but the other pr is still wrong


Jpk reactify

When I run this and go to http://localhost:58369/home/react, I hit an error in vendor.js, line 31596, could not find module "react-router-dom". When I goggled, looksed like it was a dependency that react-router forgot to put in their dependencies, so npm doesn't download. Ticket I read said it was fixed, but maybe not in the version we're using. Should react-router-dom be added to the package.json? Or maybe update react-router?

@jcubbage Well we aren't using react-router anyway so maybe @jpknoll can fix that

@jcubbage Give it another go. I need to remove one last reference in the webpack configuration.

Now getting JS error at line 79, column 154 in main.js. Just says syntax error. That line is the Hot Module Replacement line, so possible something else isn't installed yet? Not sure it if this is relevant, but I'm running without local admin. Had to temporarily grant admin to get node.js installed and npm happy.


Add support for Scala 2.12.19 and 2.13.13

Depends on

[x] https://github.com/com-lihaoyi/acyclic/pull/114
[x] https://github.com/com-lihaoyi/acyclic/pull/117
[x] https://github.com/typelevel/kind-projector/pull/271
[x] https://github.com/com-lihaoyi/Ammonite/pull/1422
[x] https://github.com/com-lihaoyi/Ammonite/pull/1424
[ ] https://github.com/typelevel/kind-projector/pull/272

Fix https://github.com/com-lihaoyi/Ammonite/issues/1420

Maybe the server needs to be updated first?

@alexarchambault Any idea why the BSP server is failing for Scala 2.13.13, but not for 2.13.12? There is no obvious error message. Since you contributed the BSP server code, maybe you have an idea or can help out?

Looks like the BSP server tests fail for many more Scala versions, we just don't run these tests in CI. I saw them fail here: https://github.com/com-lihaoyi/Ammonite/pull/1436
It's probably OK to ignore them for now, since they already broken, but users haven't reported any issues about that. So releasing for latest Scala versions is IMHO better that holding back for some minor issues.

I handled the failing test in PR https://github.com/com-lihaoyi/Ammonite/pull/1436, since we see the same issues of older Scala versions.


How to force refresh ui in an inactive activity ?

I built a video list using mvrx. I came across a scene where I paused the video on onpause() . But when I press the home button, mvrx will not refresh ui, the video is still playing. I guess, when I press the home button, the Activity has entered the background, not active, so mvrx does not respond.

Currently, there is no way to get notified about state changes in the UI (Fragment or Activity) when the screen is not active. Doing this is kind of against what MvRx is trying to do.
Imagine your MvRx state as a representation of what your users see when they are actively have the screen visible. Using clicking the pause button would pause the video by changing the state. But lifecycle can be seen as different since you want to resume when the screen comes back.

Currently, there is no way to get notified about state changes in the UI (Fragment or Activity) when the screen is not active. Doing this is kind of against what MvRx is trying to do.
Imagine your MvRx state as a representation of what your users see when they are actively have the screen visible. Using clicking the pause button would pause the video by changing the state. But lifecycle can be seen as different since you want to resume when the scr


dependencyBrowseTree throws java.lang.OutOfMemoryError

sbt version - 1.6.1
In large enough project dependencyBrowseTree task will throw OOM exception. Looking at the implementation, the tree is transformed to JSON and the result is accumulated in memory, which is written into a file on following steps. Would it be an option to write the tree directly into a file as JSON? I have a feeling this would solve the issue.
If this looks like a beneficial improvement, I could work on it.

16GB of heap was not enough 😄

but how big is the resulting JSON file? because if it's taking 16 GB of memory to write out a file which is about that size, that's one thing. but if it's using 16 GB of memory to write out a 5 MB file, then we ought to figure out why.

how much heap was enough? are you sure it's not in an infinite loop?

I did not have enough memory in my machine to successfully run it. I remember successfully running dependencyBrowseTree on a smaller module of the same project, but had to bump the heap to like 12/16GB. Cannot be sure about it not being an infinite loop, but seeing how big the dependencyBrowseGraph was, I would not be too surprised if it was simply memory issues of the current implementation.

Writing a file is the last step once model is generated, so if the model generation throws OOM, I get no file.

I see.
I guess I'm just boggled by the concept of the dependency graph actually, genuinely being so big 🙀

Another issue is that even if JSON data is generated, browsers can easily go out of memory when displaying the tree - I can see that with a JSON of 260MB the Chrome worker throws OOM, with workers disabled it just simply hangs. This needs a lazy loading implementation.

@ptrdom Thanks for the report. Could you follow the prescribed template plz? Specifically this issue seems to be missing reproducible steps. I am kind of curious if it's running out of memory because it's huge, or there's some logical error that's blowing up the size.

@eed3si9n I did encounter the issue on the private codebase, so it is not that I can share exactly how I replicated it, but I guess I could try creating a new sbt project, dump dependencies into it until I get the same failure and then share it here.

Same issue happens with dependencyTree.

We are also encountering this while calling dependencyTree on 1.6.2.  sbt 1.6.2 is quite old by now (we'll try to reproduce with recent versions), but I'm sure there are others out there who might come across this issue (notably, Snyk's Scala support relies on dependencyTree) so here are some details for posterity. @ptrdom curious to hear how you resolved this.
The project is internal and can't be shared, but includes several peculiarities:

lots of unnecessary .configs(IntegrationTest) and related settings, sometimes even .configs(IntegrationTest extend Test)
meddling with ivy configurations, so lots of compile->compile; test->test; it->it; compile->test
thine eyes deceive thee not -- the author probably intended to write test->compile but instead wrote compile->test; the former would be pointless, the latter just seems like a mistake (but it should still be technically impeccable)

The crazy thing is -- it actually worked for months on an active repo until yesterday. Months on end dependencyTree would terminate in under 2 minutes (I know...), and since the change it does not terminate, which is why I figured this is worth expanding on. This is more than just some amplification factor due to our superfluous use of configs.
I'll try to update here when we have this resolved.

@nadavwr I mainly focused on reducing the amount of redundant dependencies, which was mainly caused by transient dependencies - project had many modules depending on a lot of code that was not needed. Even though the implementation of dependencyTree implementation could definitely be improved, running into this issue very likely means that you would benefit a lot from revising your project structure.

@ptrdom Thanks for the swift reply, we're working under that assumption.
Looks like it's more of a matter of "dependency amplification" for us (needless config mess causing more dependency sprawl than would result by just the dependencies themselves, with each tree expanded multiple times). We'll try to resolve that and trim down dependencies while at it.

Could you try, if the behaviour is still present in a fresh sbt version ?
Coursier merged a PR to reduce the required memory roughly 6 month ago, which should have landed in sbt in the meantime. https://github.com/coursier/coursier/pull/2533

@mzuehlke ,
hoping this could help. We have just met the same issue using the latest sbt release 1.9.4 on GraalVM CE 17.0.8.
I started the sbt shell assigning about 8G sbt -mem 8192 and then dependencyTree

perhaps the underlying cause is algorithmic, like it's re-exploring the tree at each level of a recursion, causing an exponential blowup? seems like a really good, self-contained bug for some valiant volunteer to be a hero on
(this came up again today on Discord, is how I came here)

perhaps the underlying cause is algorithmic, like it's re-exploring the tree at each level of a recursion, causing an exponential blowup? seems like a really good, self-contained bug for some valiant volunteer to be a hero on
(this came up again today on Discord, is how I came here)

I wonder are there some libraries on maven central specifically crafted to have a very, very, very large transitive dep graph for performance stress testing.
It would be useful not only for this ticket but for a bunch of large classpath optimizations.

Btw in https://github.com/sbt/sbt/issues/7360, interesting how sbt.internal.graph.rendering.AsciiTree$.asciiTree(AsciiTree.scala:23) is called. It is only called once the dependency graph is actually made, meaning the dependency graph generation succeeded, but the ascii pretty printing ran out of memory.
Here's what I suspect. Not sure if #7360 and comments in #6886 are all referring to same issues, but for #7360, my hypothesis is that the ascii dependency tree is genuinely that large.
Consider the following simply sbt project setup
ThisBuild / version := "0.1.0-SNAPSHOT"

ThisBuild / scalaVersion := "3.3.4"

lazy val A = (project in file("A"))
  .settings(
    name := "A",
  ).dependsOn(B, C)

lazy val B = (project in file("B"))
  .settings(
    name := "B",
  ).dependsOn(C)

lazy val C = (project in file("C"))
  .settings(
    name := "C",
    // libraryDependencies += "org.apache.pekko" %% "pekko-protobuf-v3" % "1.1.2",
  )

Here's the output
[info] c:c_3:0.1.0-SNAPSHOT
[info]   +-org.scala-lang:scala3-library_3:3.3.4 [S]
[info]
[info] b:b_3:0.1.0-SNAPSHOT
[info]   +-c:c_3:0.1.0-SNAPSHOT
[info]   | +-org.scala-lang:scala3-library_3:3.3.4 [S]
[info]   |
[info]   +-org.scala-lang:scala3-library_3:3.3.4 [S]
[info]
[info] a:a_3:0.1.0-SNAPSHOT
[info]   +-b:b_3:0.1.0-SNAPSHOT
[info]   | +-c:c_3:0.1.0-SNAPSHOT
[info]   | | +-org.scala-lang:scala3-library_3:3.3.4 [S]
[info]   | |
[info]   | +-org.scala-lang:scala3-library_3:3.3.4 [S]
[info]   |
[info]   +-c:c_3:0.1.0-SNAPSHOT
[info]   | +-org.scala-lang:scala3-library_3:3.3.4 [S]
[info]   |
[info]   +-org.scala-lang:scala3-library_3:3.3.4 [S]
[info]

As Seth mentioned, ascii print is indeed reexploring the tree for adversarial input. For instance,
[info]   +-c:c_3:0.1.0-SNAPSHOT
[info]   | +-org.scala-lang:scala3-library_3:3.3.4 [S]

is included for 3 times.

I reproduced java.lang.OutOfMemoryError when running dependencyTree. Albeit I don't know if I am reproducing the same java.lang.OutOfMemoryError compared to other people hitting the issue.
https://github.com/Friendseeker/sbt-7360


🐛 Bug: Reports the Error twice when its message contains something similar to a stack

Prerequisites

[x] Checked that your issue hasn't already been filed by cross-referencing issues with the faq label
[x] Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
[x] 'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
[x] Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with: node node_modules/.bin/mocha --version(Local) and mocha --version(Global). We recommend that you not install Mocha globally.

Description
Mocha reports twice the Error instance when it contains something that looks similar to a stacktrace.
As a consequence throw new Error("Oups."); and throw new Error("Oups. at plouf (C:\\dev\\try-mocha\\test.js:9:15)"); will not be treated the same way in the report of Mocha.
Steps to Reproduce
Here is a small spec file to reproduce:
function oups() {
  throw new Error(`Oups.`);
}
function oupsStack() {
  throw new Error(`Oups. at plouf (C:\\dev\\try-mocha\\test.js:9:15)`);
}
describe("describe", () => {
  it("it oups", () => {
    oups();
  });
  it("it oupsStack", () => {
    oupsStack();
  });
});

Error related to https://github.com/dubzzz/fast-check/issues/399
Expected behavior: [What you expect to happen]
The reports of oups and oupsStack should be similar (even if oupsStack contains something similar to a stack trace).
I would have expected the following error report from mocha:
  1) describe
       it oups:
     Error: Oups.
      at oups (test\test2.js:2:9)
      at Context.<anonymous> (test\test2.js:11:5)
      at processImmediate (internal/timers.js:439:21)

  2) describe
       it oupsStack:
     Error: Oups. at plouf (C:\dev\try-mocha\test.js:9:15)
      at oupsStack (test\test2.js:6:9)
      at Context.<anonymous> (test\test2.js:14:5)
      at processImmediate (internal/timers.js:439:21)

Actual behavior: [What actually happens]
Here is the actual report I got from Mocha:
  1) describe
       it oups:
     Error: Oups.
      at oups (test\test2.js:2:9)
      at Context.<anonymous> (test\test2.js:11:5)
      at processImmediate (internal/timers.js:439:21)

  2) describe
       it oupsStack:
     Oups. at plouf (C:\dev\try-mocha\test.js:9:15)
  Error: Oups. at plouf (test.js:9:15)
      at oupsStack (test\test2.js:6:9)
      at Context.<anonymous> (test\test2.js:14:5)
      at processImmediate (internal/timers.js:439:21)

We can see that Oups. at plouf is visible twice in the log while Oups. is only visible once.
Reproduces how often: [What percentage of the time does it reproduce?]
Versions

The output of mocha --version and node node_modules/.bin/mocha --version:

mocha --version: none
node_modules/.bin/mocha --version: 6.2.0

The output of node --version: 12.6.0
Your operating system

name and version: Windows 10
architecture (32 or 64-bit): 64bits

Your shell (e.g., bash, zsh, PowerShell, cmd): git bash
Any code transpiler (e.g., TypeScript, CoffeeScript, Babel) being used (and its version): pure js without any transpilers

Sorry nobody replied sooner. Just tried this on mocha v7 on a mac and got the expected
  1) describe
       it oups:
     Error: Oups.
      at oups (test/test.spec.js:19:9)
      at Context.<anonymous> (test/test.spec.js:26:5)
      ...
      at processImmediate (internal/timers.js:445:21)

  2) describe
       it oupsStack:
     Error: Oups. at plouf (C:\dev\try-mocha\test.js:9:15)
      at oupsStack (test/test.spec.js:22:9)
      at Context.<anonymous> (test/test.spec.js:29:5)
      ...
      at processImmediate (internal/timers.js:445:21)

I believe this is now resolved in latest.

Indeed, thanks a lot 👍
It seems that the issue is now fixed with the latest version of mocha

@craigtaub While it works for the two examples above, I still have an issue when the message contained into the error looks like a stacktrace, here is an example of the issue:
function oupsStackStack() {
  const err = new Error();
  throw new Error(`An error occured with following trace:\n\n${err.stack}`);
}
describe("describe", () => {
  it("it oupsStackStack", () => {
    oupsStackStack();
  });
});

If you run this snippet with Mocha 7.2.0, you should see the error message An error occured with following trace twice in the report.
When I ran it, the reported error was the following (with mocha 7.2.0):
*bold corresponds to the red part in the report

describe
1) it oupsStackStack
0 passing (5ms)
1 failing
1) describe
it oupsStackStack:
An error occured with following trace:
Error
at oupsStackStack (C:\Users\mocha-fs\spec.js:2:15)
at Context. (C:\Users\mocha-fs\spec.js:7:5)
at callFn (C:\Users\mocha-fs\node_modules\mocha\lib\runnable.js:374:21)
at Test.Runnable.run (C:\Users\mocha-fs\node_modules\mocha\lib\runnable.js:361:7)
at Runner.runTest (C:\Users\mocha-fs\node_modules\mocha\lib\runner.js:619:10)
at C:\Users\mocha-fs\node_modules\mocha\lib\runner.js:745:12
at next (C:\Users\mocha-fs\node_modules\mocha\lib\runner.js:536:14)
at C:\Users\mocha-fs\node_modules\mocha\lib\runner.js:546:7
at next (C:\Users\mocha-fs\node_modules\mocha\lib\runner.js:448:14)
at Immediate._onImmediate (C:\Users\mocha-fs\node_modules\mocha\lib\runner.js:514:5)
at processImmediate (internal/timers.js:439:21)
Error: An error occured with following trace:
Error
at oupsStackStack (spec.js:2:15)
at Context. (spec.js:7:5)
at processImmediate (internal/timers.js:439:21)
at oupsStackStack (spec.js:3:9)
at Context. (spec.js:7:5)
at processImmediate (internal/timers.js:439:21)

While I would have expected something like:

describe
1) it oupsStackStack
0 passing (5ms)
1 failing
1) describe
it oupsStackStack:
An error occured with following trace:
Error
at oupsStackStack (C:\mocha-fs\spec.js:2:15)
at Context. (C:\mocha-fs\spec.js:7:5)
at callFn (C:\mocha-fs\node_modules\mocha\lib\runnable.js:374:21)
at Test.Runnable.run (C:\mocha-fs\node_modules\mocha\lib\runnable.js:361:7)
at Runner.runTest (C:\mocha-fs\node_modules\mocha\lib\runner.js:619:10)
at C:\mocha-fs\node_modules\mocha\lib\runner.js:745:12
at next (C:\mocha-fs\node_modules\mocha\lib\runner.js:536:14)
at C:\mocha-fs\node_modules\mocha\lib\runner.js:546:7
at next (C:\mocha-fs\node_modules\mocha\lib\runner.js:448:14)
at Immediate._onImmediate (C:\mocha-fs\node_modules\mocha\lib\runner.js:514:5)
at processImmediate (internal/timers.js:439:21)
at oupsStackStack (spec.js:3:9)
at Context. (spec.js:7:5)
at processImmediate (internal/timers.js:439:21)

Ah I see, so the message is
Error
at oupsStackStack (C:\mocha-fs\spec.js:2:15)
at Context. (C:\mocha-fs\spec.js:7:5)
at callFn (C:\mocha-fs\node_modules\mocha\lib\runnable.js:374:21)
at Test.Runnable.run (C:\mocha-fs\node_modules\mocha\lib\runnable.js:361:7)
at Runner.runTest (C:\mocha-fs\node_modules\mocha\lib\runner.js:619:10)
at C:\mocha-fs\node_modules\mocha\lib\runner.js:745:12
at next (C:\mocha-fs\node_modules\mocha\lib\runner.js:536:14)
at C:\mocha-fs\node_modules\mocha\lib\runner.js:546:7
at next (C:\mocha-fs\node_modules\mocha\lib\runner.js:448:14)
at Immediate._onImmediate (C:\mocha-fs\node_modules\mocha\lib\runner.js:514:5)
at processImmediate (internal/timers.js:439:21)

So should print that then the call stack. Odd. Not sure its a big issue but certainly seems odd.

Confirmed that the snippet in https://github.com/mochajs/mocha/issues/3992#issuecomment-634476073 gives the duplicate error stack still.

Given mocha properly handles errors with cause, I believe the recommended approach would be to use it instead of copying the stack in the message. I updated my library (fast-check) to switch to error with cause (will be the default starting at v4).