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

Add an Uncompressor #49

Closed
wants to merge 2 commits into from
Closed

Conversation

imtayadeway
Copy link
Contributor

The problem

Since we're accepting incoming compressed ids in place of actual ids, they will occasionally be passed to things that aren't expecting them, and definitely shouldn't. We don't want to update every method that deals with an id somewhere to uncompress it. (see Dialogs/Dialog Fields)

The solution

I've added an Uncompressor service which gets executed when the body is parsed. It will traverse the body, looking for things to uncompress, and will uncompress them. This seems like the right place to do it, since it only needs to happen once and nothing else will need to know about compressed ids

/cc @jntullo @eclarizio
@miq-bot add-label enhancement, technical debt
@miq-bot assign @abellotti

@miq-bot
Copy link
Member

miq-bot commented Sep 7, 2017

Checked commits imtayadeway/manageiq-api@4b8196c~...b191b9a with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
3 files checked, 0 offenses detected
Everything looks fine. ⭐

@abellotti
Copy link
Member

Any chance this will be morphing data blocks, not necessarily MiQ object resource attributes ?
Also, what's the performance impact.

imtayadeway added a commit to imtayadeway/manageiq-api that referenced this pull request Sep 18, 2017
Support for compressed ids was added and enabled by default (rendering
all ids in their compressed form) with the thought of solving two
problems at once:

1. javascript doesn't support very large numbers
2. we wanted to add support for compressed ids

It turns out that (2) wasn't solving any problems in UI land
anymore. With the added complexity and emerging issues¹ that came as a
result of this change, it seemed better to remove the compressed id
support and simply render all ids as strings instead, which is
sufficient to solve the javascript large numbers issue.

Support for incoming compressed ids in URLs has been left, since this
has already been incorporated into the Fine release.

1. See ManageIQ#49,
ManageIQ/manageiq#15658
imtayadeway added a commit to imtayadeway/manageiq-api that referenced this pull request Sep 18, 2017
Support for compressed ids was added and enabled by default (rendering
all ids in their compressed form) with the thought of killing two
birds with one stone:

1. javascript doesn't support very large numbers
2. we wanted to add support for compressed ids

It turns out that (2) wasn't solving any problems in UI land
anymore. With the added complexity and emerging issues¹ that came as a
result of this change, it seemed better to remove the compressed id
support and simply render all ids as strings instead, which is
sufficient to solve the javascript large numbers issue.

Support for incoming compressed ids in URLs has been left, since this
has already been incorporated into the Fine release.

1. See ManageIQ#49,
ManageIQ/manageiq#15658
imtayadeway added a commit to imtayadeway/manageiq-api that referenced this pull request Sep 18, 2017
Support for compressed ids was added and enabled by default (rendering
all ids in their compressed form) with the thought of killing two
birds with one stone:

1. javascript doesn't support very large numbers
2. we wanted to add support for compressed ids

It turns out that (2) wasn't solving any problems in UI land
anymore. With the added complexity and emerging issues¹ that came as a
result of this change, it seemed better to remove the compressed id
support and simply render all ids as strings instead, which is
sufficient to solve the javascript large numbers issue.

Support for incoming compressed ids in URLs has been left, since this
has already been incorporated into the Fine release.

1. See ManageIQ#49,
ManageIQ/manageiq#15658
imtayadeway added a commit to imtayadeway/manageiq-api that referenced this pull request Sep 18, 2017
Support for compressed ids was added and enabled by default (rendering
all ids in their compressed form) with the thought of killing two
birds with one stone:

1. javascript doesn't support very large numbers
2. we wanted to add support for compressed ids

It turns out that (2) wasn't solving any problems in UI land
anymore. With the added complexity and emerging issues¹ that came as a
result of this change, it seemed better to remove the compressed id
support and simply render all ids as strings instead, which is
sufficient to solve the javascript large numbers issue.

Support for incoming compressed ids in URLs has been left, since this
has already been incorporated into the Fine release.

1. See ManageIQ#49,
ManageIQ/manageiq#15658
imtayadeway added a commit to imtayadeway/manageiq-api that referenced this pull request Sep 18, 2017
Support for compressed ids was added and enabled by default (rendering
all ids in their compressed form) with the thought of killing two
birds with one stone:

1. javascript doesn't support very large numbers
2. we wanted to add support for compressed ids

It turns out that (2) wasn't solving any problems in UI land
anymore. With the added complexity and emerging issues¹ that came as a
result of this change, it seemed better to remove the compressed id
support and simply render all ids as strings instead, which is
sufficient to solve the javascript large numbers issue.

Support for incoming compressed ids in URLs has been left, since this
has already been incorporated into the Fine release.

1. See ManageIQ#49,
ManageIQ/manageiq#15658
alexander-demicev pushed a commit to alexander-demicev/manageiq-api that referenced this pull request Oct 5, 2017
Support for compressed ids was added and enabled by default (rendering
all ids in their compressed form) with the thought of killing two
birds with one stone:

1. javascript doesn't support very large numbers
2. we wanted to add support for compressed ids

It turns out that (2) wasn't solving any problems in UI land
anymore. With the added complexity and emerging issues¹ that came as a
result of this change, it seemed better to remove the compressed id
support and simply render all ids as strings instead, which is
sufficient to solve the javascript large numbers issue.

Support for incoming compressed ids in URLs has been left, since this
has already been incorporated into the Fine release.

1. See ManageIQ#49,
ManageIQ/manageiq#15658
@imtayadeway imtayadeway deleted the deserializer branch January 12, 2018 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants