markbates / markbates/cachetastic

infinite recursion

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
18
Forks
5
PR merge metrics
No merged PRs in 30d

Description

The following programme fails (tested in 3.6.0 because of issue #1):

```
require 'cachetastic'

class MyCache < Cachetastic::Cache; end
MyCache.set(1, 'hello')
```

The reported error:

```
vendor/ruby/gems/cachetastic-3.6.0/lib/cachetastic/cache.rb:127: stack level too deep (SystemStackError)
```

The code around cache.rb:127:

```
module Cachetastic
class Cache
include Singleton
...
def to_configatron(*args) # :nodoc:
self.class.to_configatron(*args)
end
...
end
end
```

I don't know what this is supposed to do, but it results in `to_configatron` to be called recursively. I can fix this is my code by overriding `to_configatron`.

Am I missing something?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the example from the issue, then inspect vendor/ruby/gems/cachetastic-3.6.0/lib/cachetastic/cache.rb around line 127 and the to_configatron method. Trace the instance-to-class delegation and determine the expected behavior; the sample should complete without a SystemStackError or recursive to_configatron calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.