Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hash as_json handle unlimited items #876

Merged
merged 1 commit into from
Oct 17, 2023
Merged

Hash as_json handle unlimited items #876

merged 1 commit into from
Oct 17, 2023

Conversation

jmthomas
Copy link
Member

closes #863

@jmthomas
Copy link
Member Author

Screenshot 2023-10-17 at 1 22 58 PM

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (fc401ed) 74.09% compared to head (84d13af) 74.09%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #876   +/-   ##
=======================================
  Coverage   74.09%   74.09%           
=======================================
  Files         612      612           
  Lines       42887    42887           
  Branches      877      877           
=======================================
  Hits        31776    31776           
+ Misses      11017    11015    -2     
- Partials       94       96    +2     
Flag Coverage Δ
frontend 60.64% <ø> (ø)
python 79.01% <ø> (ø)
ruby-api 48.44% <ø> (ø)
ruby-backend 80.32% <50.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
openc3/lib/openc3/io/json_rpc.rb 55.95% <50.00%> (ø)

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -115,9 +115,9 @@ def as_json(options = nil) #:nodoc:

class Hash
def as_json(options = nil) #:nodoc:
pairs = []
self.each { |k, v| pairs << k.to_s; pairs << v.as_json(options) }
Hash[*pairs]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was overwhelming the stack with the huge amount of items and causing a 'Stack too deep' error.

@jmthomas jmthomas merged commit 0959cbd into main Oct 17, 2023
@jmthomas jmthomas deleted the as_json branch October 17, 2023 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack to deep upon loading plugin.
2 participants