Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Cannot publish presence when having databaseConfig.redis.keyPrefix #537

Open
hcw12889 opened this issue Aug 6, 2020 · 2 comments
Open

Comments

@hcw12889
Copy link

hcw12889 commented Aug 6, 2020

I am working on multiple Laravel projects, denoted as "Project A" and "Project B".

I run laravel-echo-server for both projects.
Port 6001 for Project A
Port 6003 for Project B
Both have "databaseConfig.redis.publishPresence" enabled.

Authentication, joining and leaving channel, and Broadcasting (using Queue of Laravel) work totally fine.

However, whenever a user joins the echo server of Project A, both Project A and Project B show a "PresenceChannelUpdated" message (which I only want presence publishing from Project A solely), vice versa.

Channel: PresenceChannelUpdated
Event: [object Object]

To prevent this problem, I added keyPrefix to databaseConfig.redis for Project B.

"databaseConfig": {
"redis": {
"keyPrefix": "ProjectB_"
},
"publishPresence": true
},

Then the echo-server does not publish presence anymore, same case for Project A.

Without databaseConfig.redis.keyPrefix, it works totally fine.

Screenshot 2020-08-07 at 4 17 43 AM

With the keyPrefix, the echo-server doesn't publish presence anymore.

Screenshot 2020-08-07 at 4 19 52 AM

I also tried to use Redis database (e.g. db 0 for Project A, db 2 for Project B), but no luck with it.

Is this a bug or I am doing wrong? Any help would be appreciated.

@hcw12889
Copy link
Author

hcw12889 commented Aug 7, 2020

#516 seems to be a fix for my situation.
The keyPrefix is prepended to the presence-publishing event name.

@amumayjang
Copy link

please update fixes for master

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

No branches or pull requests

2 participants