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

Gem breaks with rails 7.1 #24

Open
skatkov opened this issue Dec 14, 2022 · 2 comments
Open

Gem breaks with rails 7.1 #24

skatkov opened this issue Dec 14, 2022 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@skatkov
Copy link
Contributor

skatkov commented Dec 14, 2022

Description

This gem breaks for rails HEAD version (e.g. 7.1), instead of usual hash structure, we're getting string representation of a hash structure.

Issue was discovered in this PR #19

Steps

  • Uncomment testing against "rails_head"
  • Run appraisal install
  • Run appraisal rake

Result

Following errors are returned for tests that run against rails head.

Error:
PbbuilderTemplateTest#test_nested_message_partial:
NoMethodError: undefined method `best_friend' for "<API::Person: name: \"Chris Harris\", friends: [], best_friend: <API::Person: name: \"Max Verstappen\", friends: [], nicknames: [], favourite_foods: {}>, nicknames: [], favourite_foods: {}>":String

    assert_equal "Max Verstappen", result.best_friend.name
                                         ^^^^^^^^^^^^
    /Users/skatkov/Code/pbbuilder/test/pbbuilder_template_test.rb:77:in `block in <class:PbbuilderTemplateTest>'
Error:
PbbuilderTemplateTest#test_basic_template:
NoMethodError: undefined method `name' for "<API::Person: name: \"hello\", friends: [], nicknames: [], favourite_foods: {}>":String

    assert_equal "hello", result.name
                                ^^^^^
    /Users/skatkov/Code/pbbuilder/test/pbbuilder_template_test.rb:26:in `block in <class:PbbuilderTemplateTest>'

Expected result

Instead of a hash structure returned as it was before, now string representation of hash is being returned.

@skatkov skatkov added the bug Something isn't working label Dec 14, 2022
@skatkov skatkov added this to the v1.0 milestone Oct 20, 2023
@julik
Copy link
Contributor

julik commented Feb 5, 2024

It looks like we are not alone - the ActionView API has changed and it converts rendered data into strings

rails/rails#50930

In a way this would be an interesting excercise (a proto message is a string of bytes after all) but at what cost?

@julik
Copy link
Contributor

julik commented Feb 10, 2024

And this got fixed upstream in rails/rails#51023 @skatkov can you check whether it works again?

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

Successfully merging a pull request may close this issue.

2 participants