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

"Checksum does not match" when kwargs parameter is not defined on class #140

Closed
frbor opened this issue Jan 31, 2021 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@frbor
Copy link

frbor commented Jan 31, 2021

I upgraded to 0.18.0, but started to see responses with

{"error": "Checksum does not match"}

on one of the pages.

My problem was a component like this:

class MyView(UnicornView):
    text = "hello"
    active = None

    def __init__(self, *args, **kwargs):
        super().__init__(**kwargs)
        self.active = kwargs.get("active_tab", "default")

In the data sent I saw both active and active_tab.

It was an easy fix for me (I just made sure the parameter in kwargs was named the same as the class variable), but I thought other might get into the same problem, so i'm reporting it as a bug.

You can see the problem in action in this branch in the validation example:

I'm sorry if I overlooked any of this in the documentation, but I'm not sure whether this should work?

There might also be other reasons to send a parameter to kwargs without assigning it to the component?

On a side note I have had a couple of issues previously with the "Checksum does not match" error. I'm not sure what is checksumed, so might add that to the documentation some place?

Anyhow, impressive progress on the project. It has come a long way so far and keeps getting better!

@frbor frbor changed the title "Checksum does not match" when kwarg is not defined on class "Checksum does not match" when kwargs paraemter is not defined on class Jan 31, 2021
@frbor frbor changed the title "Checksum does not match" when kwargs paraemter is not defined on class "Checksum does not match" when kwargs parameter is not defined on class Jan 31, 2021
@adamghill
Copy link
Owner

Thanks for the bug report (again!). I can replicate this issue, so hopefully I can fix this pretty quickly.

I will try to document the "Checksum does not match" error somewhere as well. I added some code to potentially alleviate it, but it basically happens when a page "gets out of sync" and Unicorn can't figure out what the correct state should be. I'll continue to try to reduce how frequently that happens as I see it in testing.

@adamghill adamghill self-assigned this Feb 1, 2021
@adamghill adamghill added the bug Something isn't working label Feb 1, 2021
@adamghill
Copy link
Owner

I just released 0.18.1 which should allow component kwargs to differ from component attributes again. Closing for now, but I added a note to adamghill/django-unicorn.com#2 to document checksums somewhere in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants