Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Unexpected exception on redis disconnect Redis - NoMethodError(undefined method `destroy' for nil:NilClass)

Abierto
#362 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
rails, redis, ruby
Área
backend

Línea de trabajo

Comienza en ruby/hyper-operation/transport/connection_adapter/redis.rb, línea 66, y luego lee la cadena de llamadas de disconnect a través de connection.rb y action_cable.rb. Rastrea por qué la ruta de desconexión de Redis llega a destroy sobre nil; se considera terminado cuando desconectar un canal ya no provoca el NoMethodError informado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

I switched recently to the new Redis message functionality and I get the following exception in production.log

I, [2021-02-25T14:13:45.826641 #1289]  INFO -- : Finished "/cable/" [WebSocket] for 127.0.0.1 at 2021-02-25 14:13:45 +0200
I, [2021-02-25T14:13:45.830986 #1289]  INFO -- : Hyperstack::ActionCableChannel stopped streaming from hyperstack-AnnouncementCategory
I, [2021-02-25T14:13:45.926758 #1266]  INFO -- : Finished "/cable/" [WebSocket] for 127.0.0.1 at 2021-02-25 14:13:45 +0200
I, [2021-02-25T14:13:45.933053 #1266]  INFO -- : Hyperstack::ActionCableChannel stopped streaming from hyperstack-AnnouncementCategory
I, [2021-02-25T14:13:46.010028 #1266]  INFO -- : Hyperstack::ActionCableChannel stopped streaming from hyperstack-Epos::Applicant-423783
I, [2021-02-25T14:13:46.028519 #1266]  INFO -- : Hyperstack::ActionCableChannel stopped streaming from hyperstack-Hyperstack::Session-e570d5777171d6ae432a94fef3735d11
E, [2021-02-25T14:13:46.159163 #1289] ERROR -- : There was an exception - NoMethodError(undefined method `destroy' for nil:NilClass)
E, [2021-02-25T14:13:46.162694 #1289] ERROR -- : /home/app/shared/bundle/ruby/2.7.0/bundler/gems/hyperstack-f07d016b626a/ruby/hyper-operation/lib/hyper-operation/transport/connection_adapter/redis.rb:66:in `disconnect'
/home/app/shared/bundle/ruby/2.7.0/bundler/gems/hyperstack-f07d016b626a/ruby/hyper-operation/lib/hyper-operation/transport/connection.rb:68:in `disconnect'
/home/app/shared/bundle/ruby/2.7.0/bundler/gems/hyperstack-f07d016b626a/ruby/hyper-operation/lib/hyper-operation/transport/action_cable.rb:36:in `unsubscribed'

I had the same problem when using the db message store and back then i had to patch hyperstack.rb initializer with the following patch from @catmando :

module Hyperstack
  class Connection < ActiveRecord::Base
    def self.disconnect(channel)
      puts "\ndisconnecting from #{channel}\n" if Rails.env.development?
      c = find_by(channel: channel, session: nil)
      if c
        c.destroy
      else
        puts "\n********************** WARNING #{channel} has not been opened.  Why are we disconnecting ?????????? \n"
      end
    end
  end
end

Why is this happeing?

Lenguaje dominante
JavaScript
Estrellas
538
Forks
41
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de hyperstack-org/hyperstack

Todos los issues de hyperstack-org/hyperstack

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.