# 20210204(목)

## 2021-02-04

### 1. 학습 날짜

* 2020-02-04

### 2. 학습 시간

* 11:00 \~ 24:00

### 3. 학습 범위 및 주제

* 액션케이블 문제 해결하기

### 4. 학습 목표

* 액션 케이블에 대한 이해를 높이고 문제를 해결하자

### 5. 학습 정리

* <https://simian114.gitbook.io/blog/undefined/rubyonrails/consumer>

### 6. 상세 학습 내용

* 서비스에서 로그아웃을 하고 로그인을 해도 이전에 로그아웃했던 유저가 그대로 남아있는 문제가 있었다.
* 이 문제는 로그아웃을 해도 커넥션이 끊기지 않아서 생기는 문제였다. 커넥션이 끊기지 않으면 프론트와 백에서 의 괴리가 생겨버린다.
* 자 그렇다면 어떻게 커넥션을 명시적으로 끊을수있을까?
* 바로 consumer 객체를 이용하는 것이다.
* Consumer 객체는 `consumer.js` 파일에서 `import` 해서 사용할 수 있다.
* consumer 객체는 현재 자신이 구독하고 있는 채널들의 목록을 확인할 수 있고 또한 각 채널에 직접 접근해서 unsubscribe, 또는 각 채널에 만들어져있는 고유의 함수들을 호출할 수 있다!
* 앞으로 이 Consumer을 사용하기 쉽게 헬퍼함수를 만들고 이용하면 좋을거같다.

### 7. 오늘 학습 내용에 대한 개인적인 총평

* 오늘은 정말 최악중에 최악이다... 12시간이 넘는 시간동안 집중을 하나도 안했다 참...

### 8. 다음 학습 계획

* 사이드바 버튼 액션 추가


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://simian114.gitbook.io/blog/undefined-1/diary/2021/february/20210204.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
