statamic / collaboration

Real-time, multi-user editing with Statamic via websockets
https://statamic.com/addons/statamic/collaboration
33 stars 13 forks source link

Clarify requirements for basic usage #100

Closed carolineferraby closed 5 months ago

carolineferraby commented 5 months ago

Tried adding the Collaboration addon (version 0.8.1) to my Statamic project (version 4.5.7.0) on Laravel 10, and the listed addon "features" (presence indicators for multiple people, fields getting locked, etc.), are not working on the site.

I followed every step in the installation documentation, so I am now at a loss why it isn't working as expected. Wondering if there are any additional requirements or "gotchas" that aren't mentioned in the documenation. Here a few guesses I've brainstormed:

  1. When creating a Pusher account, you could create either a "Channels" app or a "Beams" app. I created a Channels app, as that seemed the most appropriate, but maybe I was wrong.
  2. Our site has three different environments (1 domain for each environment), so when initializing our Pusher app, I selected the checkbox to create apps for multiple environments. When adding the app keys to our .env files, I made sure the -development app keys matched the developement .env file and so on, but maybe the addon wasn't intended to be used this way. All of our environments are using Statamic Pro.
  3. Instead of flat files, we are using a database. We have also created symbolic links in config/filesystems.php for content files.
  4. Users do not have an avatar image field, not sure if that is required.

It would also be helpful to have a way to test the addon. I can view my Pusher app (for the development env, where I am testing) and see graphs that show multiple people/users connecting, however this does not have any affect on the control panel when multiple users are editing the same collection entry.

duncanmcclean commented 5 months ago

Have you enabled "Client Events" in your Pusher app's settings?

CleanShot 2024-04-22 at 20 13 43

carolineferraby commented 5 months ago

Yes I have enabled client events

duncanmcclean commented 5 months ago

Hmm, that's always been the gotcha for me 🤔

When you're testing, are you logged in as the same user in two browser windows, or separate users?

carolineferraby commented 5 months ago

I logged in as two separate users (using different emails / user accounts) in two browser windows.

duncanmcclean commented 5 months ago

Have you enabled "Client Events" in your Pusher app's settings?

And just to double check, you enabled this in the settings of each of the apps Pusher created? (it creates a different "app" for each environment)

carolineferraby commented 5 months ago

Yes correct, I enabled it for each environment (so three times). Though for testing, I've only pushed up the code and tested on the development environment so far.

carolineferraby commented 5 months ago

I'm not sure if this is related, but I'll mention it in case it is -- I also ran into the issue where the 'php artisan vendor:publish --tag=collaboration' command did not publish a config file. Instead I got this as the terminal output message: "Publishing [collaboration] assets. Copying directory [vendor/statamic/collaboration/resources/dist/build] to [public/vendor/collaboration/build]."

duncanmcclean commented 5 months ago

What does your composer.json file look like?

carolineferraby commented 5 months ago

composer.json

carolineferraby commented 5 months ago

Okay, this is very strange, but the addon suddenly started working this morning, and I'm not sure why. Not sure if it needed a few days? The code was definitely deployed (on April 19th) because we could see the addon listed in the control panel, and we could see our stats/connections on the pusher app, it just wasn't working in the control panel. I don't think it was a caching issue -- we ran the commands to clear any statamic or laravel cache, and we don't have any caching on our dev server. The only other variable is an issue on dev we were having simultaneously, which is that we ran a migration to copy a bunch of files and accidentally filled the disk so fast that it crashed (now resolved).

When I push up the addon code to our QA site, and I edit the .env file on the QA server, I'll see if I can replicate the issue. I'll see if it works right away, or if I have to give it a few days.

duncanmcclean commented 5 months ago

Very weird. Since it's working now for you and I can't spot any issues on my end, I'll close this issue. If you're still experiencing issues in a few days, leave a comment and we can re-open. Thanks!