Git Product home page Git Product logo

collaboration's Introduction

Statamic Logo

About Statamic

Statamic is the flat-first, Laravel + Git powered CMS designed for building beautiful, easy to manage websites.

Note: This repository contains the code for the Statamic application. To contribute to the core package, visit the Statamic core package repository.

Learning Statamic

Statamic has extensive documentation. We dedicate a significant amount of time and energy every day to improving them, so if something is unclear, feel free to open issues for anything you find confusing or incomplete. We are happy to consider anything you feel will make the docs and CMS better.

Support

We provide official developer support on Statamic Pro projects. Community-driven support is available on the forum and in Discord.

Contributing

Thank you for considering contributing to Statamic! We simply ask that you review the contribution guide before you open issues or send pull requests.

Code of Conduct

In order to ensure that the Statamic community is welcoming to all and generally a rad place to belong, please review and abide by the Code of Conduct.

Important Links

collaboration's People

Contributors

brad-sf avatar dependabot[bot] avatar duncanmcclean avatar granitibrahimi avatar helloiamlukas avatar jackmcdade avatar jasonvarga avatar jesseleite avatar lotarbo avatar robdekort avatar ryanmitchell avatar sauerbraten avatar theutz avatar wiebkevogel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

collaboration's Issues

Missing functionality

When we installed this addon and tried it out the first part with presence indicators works fine, but the rest is not happening:

  • Fields get locked when someone else focuses them.
  • Updates to field values are reflected to everyone.

Is there anything we need to do to enable / be aware of to make it work?

No connection for Global content

It seems collaboration does not work for Global content. Perhaps this is because the content is structured differently and stored in the data array?

Screen Shot 2021-08-10 at 4 02 53 pm

Broken bard field after live preview was opened

If several users work in the same entry, the bard field can be broken. Reproducible by:

  1. user 1 blocks bard field and adds a set
  2. user 2 sees set collapsed (at this point, maybe not quite as bad as I thought)
    Bildschirmfoto 2019-11-07 um 09 39 50
  3. user 2 goes to live preview and closes the live preview again
  4. user 2 will not see the sets in the bard field correctly anymore
    Bildschirmfoto 2019-11-07 um 09 42 56

Can't update to v0.8

I'm seeing this in my CI pipeline after updating from v0.7 to v0.8

In CurlDownloader.php line 630:
                                                                               
  The "https://github.com/statamic/collaboration/releases/download/v0.8.0/dis  
  t.tar.gz" file could not be downloaded (HTTP/2 404 )  

Collaboration addon thumbnails appear broken when mixing local and production users

Bug description

The Issue

If you run the Collaboration addon on both local environment production environments, a local user's avatar will appear as a broken thumbnail to the production user.

Here are a couple of screenshots from different Statamic installations

Screenshot 2023-05-15 at 12 16 08
Screenshot 2023-05-15 at 12 18 34

More information

This happens on both v3 and v4

I suppose you could just say "Don't run the addon locally" but since I work locally 90% of the time, including making edits, using Collaboration is really handy to see if a user is editing the same page I'm on, so I know to avoid conflicts.
It works great between local/production apart from this thumbnail issue.

How to reproduce

  1. Set up Collaboration locally
  2. Set up Collaboration on a production environment
  3. Log in as user1 on a particular entry on the local environment
  4. Log in as user2 on the same entry on the production environment
  5. On the production environment, observe user1's avatar appears as a broken thumbnail

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 9.52.5
PHP Version: 8.1.5
Composer Version: 2.3.3
Environment: local
Debug Mode: ENABLED
URL: thelens.wip
Maintenance Mode: OFF

Cache
Config: CACHED
Events: NOT CACHED
Routes: CACHED
Views: CACHED

Drivers
Broadcasting: pusher
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 3
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 3.4.9 PRO

Statamic Addons
jaygeorge/admin-styler: dev-main
statamic/collaboration: 0.6.0
statamic/seo-pro: 4.0.1

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

runtime (new)

Additional details

No response

Temporary connection loss can lead to data loss

When a user A loses connection temporarily and misses changes to a field done by another user B, A will not see the changes by B. When A now changes the field herself, her old state plus her changes are sent to user B, overriding his earlier changes.

Tracking the field state over time, it goes like this:

  1. A and B see foo
  2. A goes offline
  3. B adds bar to the field
  4. A sees foo, B sees foobar
  5. A reconnects, still sees foo
  6. A adds bla to the field
  7. A's change is sent to B
  8. A and B both see foobla

Doesn't work if site handle has dots)

Hello, I use domain as site handle.
And i have 403 error on broadcasting/auth
I think it because method channelNameMatchesPattern returns false
This is what i have

$channel = entry.c3377fe3-0335-4f7f-9827-36228c855b29.example.com
$pattern = entry.{id}.{site}

Statamic 4.25.0

Large Bard field values fail to synchronize

Pusher only supports payloads up to 10KB. Bard fields with a lot of content exceed this limit and changes made by one user are invisible to everyone else.

They suggest a few solutions here: https://support.pusher.com/hc/en-us/articles/360019115473

Another way forward could be to make use of tiptap's/prosemirror's support for collaboration where only the changes instead of the entire new field value is sent to peers, but this requires special casing Bard fields.

New contents in stack are deleted after publication

When editing entries with several users, we have the problem that edited entries in a stack can be deleted by publishing them, for example:

User 1: is in the entry and makes a change
User 2: opens another entry from the same entry (Relationship-Fieldtype: edit) in a stack and make some changes
User 1: stores and publishes the new content
User 2: gets a notification and has only the possibility to reload the page and not save its changes any more

Suggestion would be to include a "cancel" button in the dialog, so that user 2 gets the possibility to save or continue. What did you think?

Attempting websocket connection - Taxonomies

Bug description

I've configured pusher, it works great on collections - but doesn't seem to work on Taxonomies or Globals? The message below is permanently shown.

Screenshot 2022-03-05 at 07 57 33

Is there additional configuration required to make it work with Taxonomies and Globals?

It appears Pusher is working, just not everywhere?

How to reproduce

  • Install Pusher, login as two users
  • Navigate both users to a collection entry to verify it works
  • Navigate both users to a taxonomy term.

Logs

There are no logs in storage/logs

Versions

Statamic 3.2.36 Pro
Laravel 8.83.2
PHP 8.0.8
statamic/collaboration 0.3.0

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Support Statamic 3.3

Would this be as straightforward as updating the version constraints in the composer.json file?

Data loss when second user enters entry

Description

When a second user opens an entry while an other user is editing a bard field, the typed content will disappear and the cursor will focus to the end of the document.

How to reproduce

  1. User A opens an entry that includes a bard field
  2. The bard field of this entry includes at least two paragraphs/lines
  3. User A writes text in the first paragraph/line of the bard field
  4. While User A is typing, User B is opening the entry in the browser
  5. A part of the typed text of User A will disappear and the focus of the cursor will be at the end of the paragraph/line.

It seems like when the second user enters, an update is broadcasted โ€“ but this update still includes the old content.

No Locking or Field Updates - Only Presence Indicators

Great add-on. Thanks.

The presence indicators work well, but the Field Locking and Field Updates I cannot get to work.

Any ideas?

Statamic 3.3.26 Pro
Laravel 8.83.23
PHP 8.0.21
aryehraber/statamic-logbook 2.1.0
statamic/collaboration 0.4.0
statamic/ssg 1.1.0
swiftmade/statamic-clear-assets 1.1.0
webographen/statamic-admin-log 1.0.6
withcandour/aardvark-seo 2.0.28

I can see a tonne of console logs...

[Collaboration] ๐Ÿ“ฃ Broadcasting "chunked-saved" ...

But only broadcasts and no receiving. No console errors.

Tested in Safari and Chrome.

Thoughts?

ArgumentCountError: Too few arguments to function Statamic\Providers\RouteServiceProvider::Statamic\Providers\{closure}(), 1 passed and exactly 2 expected

Hi,

I'm getting an odd error from the RouteServiceProvider when the collaboration package attempts to hit /auth for authorizing broadcasting. I can't figure out why this is.

Request POST /broadcasting/auth
socket_id=135853.30805883&channel_name=presence-entry.6dbca0a3-b33e-4382-bd5c-f83e2f4fe74b.default

Error

ArgumentCountError: Too few arguments to function Statamic\Providers\RouteServiceProvider::Statamic\Providers\{closure}(), 1 passed and exactly 2 expected in file C:\Users\marius\OneDrive\Desktop\kunder - custom\redacted\vendor\statamic\cms\src\Providers\RouteServiceProvider.php on line 167

#0 [internal function]: Statamic\Providers\RouteServiceProvider->Statamic\Providers\{closure}('default')
#1 C:\Users\marius\OneDrive\Desktop\kunder - custom\redacted\vendor\laravel\framework\src\Illuminate\Broadcasting\Broadcasters\Broadcaster.php(192): call_user_func(Object(Closure), 'default')
#2 C:\Users\marius\OneDrive\Desktop\kunder - custom\redacted\vendor\laravel\framework\src\Illuminate\Broadcasting\Broadcasters\Broadcaster.php(173): Illuminate\Broadcasting\Broadcasters\Broadcaster->resolveExplicitBindingIfPossible('site', 'default')
#3 C:\Users\marius\OneDrive\Desktop\kunder - custom\redacted\vendor\laravel\framework\src\Illuminate\Broadcasting\Broadcasters\Broadcaster.php(107): Illuminate\Broadcasting\Broadcasters\Broadcaster->resolveBinding('site', 'default', Array)
#4 [internal function]: Illuminate\Broadcasting\Broadcasters\Broadcaster->Illuminate\Broadcasting\Broadcasters\{closure}('default', 'site')
#5 C:\Users\marius\OneDrive\Desktop\kunder - custom\redacted\vendor\laravel\framework\src\Illuminate\Collections\Collection.php(695): array_map(Object(Closure), Array, Array)

PHP 8 support (incompatible Pusher lib version)

Hi!

Thanks for your work on this rad plugin ๐Ÿ‘

I'd like to ask for PHP 8 support. statamic/collaboration requires pusher/pusher-php-server "~3.0", however PHP 8 support in this package was introduced in v4.1.5.

Would it be possible to migrate that dependency?

Ensure it is constrained to a single hostname

At the moment, changes will be communicated regardless of the hostname/domain as long as the Pusher credentials are shared.

An example of where usage on a single hostname is important:
A workflow where pull requests for new features result in a newly spun up site. The PR'd site should not communicate with sites on other branches.

Call to undefined method App\Models\User::name()

Hi folks. I'm trying out this package and the installation seem to be ok. But the UI gets stuck trying to connect to the socket.

image

Checking the network I can see that the /broadcasting/auth request is failing do to Call to undefined method App\Models\User::name().

I'm using the Eloquent Driver for the users and here's my configs:

// app/Models/User.php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;

class User extends Authenticatable
{
    use HasApiTokens, HasFactory, Notifiable;

    // ...
}
// config/auth.php

'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\Models\User::class,
        ],
]
//config/statamic/users.php

'repository' => 'eloquent',

I tried extending the User model from Statamic\Auth\Eloquent\User but this brought my server down.

Collaboration Addon - Icons not round?

Super small thing, but I noticed the icon indicating a field is locked isn't round.
Screenshot 2023-06-08 at 11 36 15

Environment
Application Name: Statamic
Laravel Version: 10.13.2
PHP Version: 8.2.6
Composer Version: 2.5.7
Environment: local
Debug Mode: OFF
URL: preview.website.com
Maintenance Mode: OFF

Cache
Config: CACHED
Events: NOT CACHED
Routes: CACHED
Views: CACHED

Drivers
Broadcasting: pusher
Cache: redis
Database: mysql
Logs: stack / single
Mail: smtp
Queue: redis
Session: file

Statamic
Addons: 1
Antlers: runtime
Stache Watcher: Enabled
Static Caching: half
Version: 4.6.0 PRO

Statamic Addons
statamic/collaboration: 0.6.0

Getting a Attempting websocket connection...

I have Statamic 4 deployed with Fly.io and on editing in production, I keep getting this error.

When in dev it is just fine, which I assume has to do with the force_https for Fly.

New users should get the latest state

If user A is in the middle of editing, and hasn't saved yet
When user B joins they'd see the latest working copy.

When user B joins, user A should broadcast their entire state.

Collaboration addon thumbnails appear broken when mixing local and production users

Bug description

The Issue

If you run the Collaboration addon on both local environment production environments, a local user's avatar will appear as a broken thumbnail to the production user.

Here are a couple of screenshots from different Statamic installations

Screenshot 2023-05-15 at 12 16 08
Screenshot 2023-05-15 at 12 18 34

More information

This happens on both v3 and v4

I suppose you could just say "Don't run the addon locally" but since I work locally 90% of the time, including making edits, using Collaboration is really handy to see if a user is editing the same page I'm on, so I know to avoid conflicts.
It works great between local/production apart from this thumbnail issue.

How to reproduce

  1. Set up Collaboration locally
  2. Set up Collaboration on a production environment
  3. Log in as user1 on a particular entry on the local environment
  4. Log in as user2 on the same entry on the production environment
  5. On the production environment, observe user1's avatar appears as a broken thumbnail

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 9.52.5
PHP Version: 8.1.5
Composer Version: 2.3.3
Environment: local
Debug Mode: ENABLED
URL: thelens.wip
Maintenance Mode: OFF

Cache
Config: CACHED
Events: NOT CACHED
Routes: CACHED
Views: CACHED

Drivers
Broadcasting: pusher
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 3
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 3.4.9 PRO

Statamic Addons
jaygeorge/admin-styler: dev-main
statamic/collaboration: 0.6.0
statamic/seo-pro: 4.0.1

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

runtime (new)

Fields doesnt update after another user change some text on random field

So, i just downloaded this package, i can hear the sounds that another user joined the page which im filling, also i can see the user-s icon and etc at the top.

However when another user or me update some field on this page, i cant see the changes in field, still need to refresh the page to see the changes.

Data loss due to Pusher error

Bug

When having a large document, live updates are chunked. The size of the chunk is set to 8000 characters.

const chunkSize = 8000;

In certain cases this causes updates not to be broadcasted, as the maximum message size of 10kb is exceeded. This error neither shows up in the editor, nor in the console.

This can lead to data loss: As editors will not be able to see changes by others, they might overwrite their content by saving the document.

By turning on Pusher logs via Pusher.logToConsole = true; it is possible to see the full error message

Pusher : Event recd : {"event":"pusher:error","data":{"code":null,"message":"The data content of this event exceeds the allowed maximum (10240 bytes). See https://pusher.com/docs/channels/server_api/http-api#publishing-events for more info"}}

Solution

An easy solution for this would be to decrease the chunk size.

const chunkSize = 8000;

Since one character can have up to 4 bytes, the safest would be to set the chunk size from 8000 to 2500.

SyntaxError: Cannot use import statement outside a module

Getting this running again locally and the JS is throwing some errors.

Uncaught SyntaxError: Cannot use import statement outside a module

image

Also, maybe related, the js/audio resources didn't auto-publish, and the vendor:publish script didn't work so I had to manually copy and paste the files into place. maybe this stems from me not copying everything or something, or my symlinked sandbox?

Clarify requirements for basic usage

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.

JS error in CP

Client asked if they could work together so good reason to try out this addon :). I got a JS error though:

SyntaxError: Unexpected identifier 'Manager'. import call expects exactly one argument.

Also had to manually publish the assets #25

Vendor publish command fails

Not sure if this is intentional or not but this addon doesn't have the production assets compiled. I think this might be because in the future you're planning on implementing Jason's composer dist package, like in core.

Although, for testing, it might be a good idea to ask users to compile the assets before they publish because it just throws errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.