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

fix: hopefully actually fixes bug in category builder for 'constructor' word (and other prototype stuff) #565

Merged
merged 1 commit into from
May 8, 2024

Conversation

ErikBjare
Copy link
Member

@ErikBjare ErikBjare commented May 7, 2024

Follow up on #564


🚀 This description was created by Ellipsis for commit b5e9eb0

Summary:

Updated CategoryBuilder.vue to use Map for storing words, replacing object structure to handle prototype-related issues correctly.

Key points:

  • Changed data structure for storing words from object to Map in CategoryBuilder.vue.
  • Replaced in keyword with Map methods (has, get, set) to avoid prototype pollution.
  • Ensures words like 'constructor' are handled correctly.

Generated with ❤️ by ellipsis.dev

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to b5e9eb0 in 21 seconds

More details
  • Looked at 26 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 additional comments because they didn't meet confidence threshold of 50%.
1. src/views/settings/CategoryBuilder.vue:227:
  • Assessed confidence : 0%
  • Comment:
    The changes from using an object to a Map for storing words are correctly implemented. This should prevent issues with words that match Object properties like 'constructor'. Good job on this fix.
  • Reasoning:
    The PR changes the way words are stored and accessed from an object to a Map. This is a good change for handling properties that have names that could conflict with object properties (like 'constructor'). The changes are consistent and correctly implemented across the modified lines.

Workflow ID: wflow_0JibP7twdPhVnItF


You can customize Ellipsis with review rules, user-specific overrides, quiet mode, and more. See docs.

12 days left in your free trial, upgrade for $20/seat/month or contact us.

Copy link

codecov bot commented May 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 25.60%. Comparing base (cb83d12) to head (b5e9eb0).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #565   +/-   ##
=======================================
  Coverage   25.60%   25.60%           
=======================================
  Files          27       27           
  Lines        1613     1613           
  Branches      286      286           
=======================================
  Hits          413      413           
- Misses       1141     1174   +33     
+ Partials       59       26   -33     

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

@ErikBjare
Copy link
Member Author

@john30 Haven't tested (again), but I think this should be correct now.

@ErikBjare ErikBjare merged commit 9d58554 into master May 8, 2024
8 checks passed
@ErikBjare ErikBjare deleted the dev/fix-constructor-words-again branch May 8, 2024 07:24
Copy link

@john30 john30 left a comment

Choose a reason for hiding this comment

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

sorry but still not correct. as commented before, all occasions of this.words need to be checked and most probably adjusted as well.
just try the following in the browser console:
your patch would yield in behaviour such as m=new Map();m.set('example',1);console.log(Object.keys(m)) resulting in an empty array instead of an array with 'example' as the single element, because the Map can not be used like this.
instead, new Map().keys() would have to be used but it returns an iterator (and not an array as expected somewhere in the code) so that needs to be adjusted accordingly

just out of curiosity: why do you push and merge immediately before anyone had the chance to review it?

@ErikBjare
Copy link
Member Author

ErikBjare commented May 9, 2024

@BelKed fixed in #569

just out of curiosity: why do you push and merge immediately before anyone had the chance to review it?

Eagerness, clearly to a fault in this case. Sorry about that. Was juggling many PRs and was hoping to get this one over with.

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.

None yet

2 participants