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

Util::Tinycache unless: argument missmatch #19

Closed
johannes-krude opened this issue Dec 17, 2021 · 1 comment
Closed

Util::Tinycache unless: argument missmatch #19

johannes-krude opened this issue Dec 17, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@johannes-krude
Copy link
Contributor

In lib/matrix_sdk/util/tinycache.rb:103, the proc is called with three arguments

unless_proc&.call(self, method_name, args)

, but the proc created in vi lib/matrix_sdk/room.rb:36, only takes a single argument

unless: proc { |args| args.any? }

When calling Room#all_members, this results in:

	1: from .../.gem/ruby/2.7.0/gems/matrix_sdk-2.4.0/lib/matrix_sdk/util/tinycache.rb:103:in `block (2 levels) in build_cache_methods'
.../.gem/ruby/2.7.0/gems/matrix_sdk-2.4.0/lib/matrix_sdk/room.rb:36:in `block in <class:Room>': undefined method `any?' for #<MatrixSdk::Room:0x0000564f3dd6a780> (NoMethodError)

Possible solutions may be:

  • Adding more arguments in room.rb
  • Removing arguments in tinycache.rb
  • Asking Proc#arity for the number of required arguments
@ananace ananace added the bug Something isn't working label Dec 17, 2021
@ananace
Copy link
Owner

ananace commented Dec 17, 2021

That's a bit of an oops on my part, I had support for three arities written, but that code got lost during some git branch shenanigans. Thanks for the reports

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