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

Fixed shortener multi level shortening #449

Merged
merged 4 commits into from
May 24, 2024

Conversation

danielmorell
Copy link
Collaborator

Description of the change

This PR fixes the key matching shortener logic that was preventing deep shortening of the payload.

There are a few significant changes here:

  1. The shortner transform is moved to the beginning of the transforms. There is no point scrubbing data if we are just going to remove it.
  2. A shortener key that ends with a '*' key will not only match everything at that level it will also match all of the children of that key.
  3. The shortener keys are uses to set a "base level" for maxlevel. Each level deep than the shortener key is checked to see if it exceeds the maxlevel. This is only applied if the key matches and ends with a final '*' key.

Because this may have a meaningful change in the frame data we are sending, I think this should be a minor change not a patch. I also think we should release this as a beta initially. This would be v1.1.0-beta0.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Maintenance
  • New release

Related issues

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers assigned
  • Issue from task tracker has a link to this pull request
  • Changes have been reviewed by at least one other engineer

This reverts commits:
 - "traverse dict for recursive shortening" 764ee1f
 - "correct algo" 97c2a32
 - "simplify algo" ded614b
 - "traverse object" 0dcad82
 - "final version" eda09e5
 - "correct unit tests" d79b19b
 - "added support for max_level" a32094b
 - "fix bug in the previous test" debe4dc
 - "added test for multi level shortening" e46e8e1
@danielmorell danielmorell added this to the 1.1.0 milestone May 9, 2024
@danielmorell danielmorell requested a review from alif May 9, 2024 12:18
@alif alif requested review from waltjones and pawelsz-rb May 10, 2024 23:34
Copy link
Collaborator

@pawelsz-rb pawelsz-rb left a comment

Choose a reason for hiding this comment

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

lgtm, great work

@danielmorell danielmorell merged commit 00cd4d5 into master May 24, 2024
85 checks passed
@danielmorell danielmorell deleted the fixed/shortener-multi-level-shortening branch May 24, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants