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

Eager load MemoryCacheDebounceAdapter #274

Merged
merged 1 commit into from
Apr 4, 2023

Conversation

julianrubisch
Copy link
Contributor

Bugfix

Description

autoloading MemoryCacheDebounceAdapter intermittently caused uninitialized constant CableReady::Updatable::MemoryCacheDebounceAdapter as reported by @obie and others. back to eager loading it.

Checklist

  • My code follows the style guidelines of this project
  • Checks (StandardRB & Prettier-Standard) are passing

@julianrubisch julianrubisch self-assigned this Mar 30, 2023
@netlify
Copy link

netlify bot commented Mar 30, 2023

Deploy Preview for cableready ready!

Name Link
🔨 Latest commit 814eab4
🔍 Latest deploy log https://app.netlify.com/sites/cableready/deploys/642a8a36ffd6fd0008678377
😎 Deploy Preview https://deploy-preview-274--cableready.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@julianrubisch julianrubisch merged commit aa31451 into main Apr 4, 2023
@julianrubisch julianrubisch deleted the fix-debounce-adapter-autoload branch April 4, 2023 11:03
@Matt-Yorkley
Copy link
Contributor

Matt-Yorkley commented May 28, 2023

I'm still getting class-loading weirdness with this when using the CableReady::Updatable concern. I've tried applying these changes but the problem just shifts to a slightly different one which gives me intermittent errors saying enable_cable_ready_updates is undefined in the including class...?

Slapping a require "cable_ready/updatable/memory_cache_debounce_adapter" at the top of the concern and calling the debouncer by it's base class name seems to do the trick?

require "active_support/concern"
++ require "cable_ready/updatable/memory_cache_debounce_adapter"

module CableReady
  module Updatable
    extend ::ActiveSupport::Concern
    
--     mattr_accessor :debounce_adapter, default: ::CableReady::Updatable::MemoryCacheDebounceAdapter.instance
++     mattr_accessor :debounce_adapter, default: MemoryCacheDebounceAdapter.instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants