Skip to content

Debugging ​

The collaboration inspector is a slide-over showing what this tab syncs: round trip, sequence, unsent changes and each field's state. It never shows field contents.

php
use SolutionForest\FilamentCollaboration\Actions\CollaborationDebugAction;

protected function getHeaderActions(): array
{
    return [
        CollaborationDebugAction::make(),
        // ...
    ];
}

It stays hidden unless the panel enables it:

php
CollaborationPlugin::make()->debug(fn (): bool => app()->isLocal());
The inspector

When the rich editor fails. Should ProseMirror refuse a change, the editor shows the shared draft again with the caret where it was. Nothing typed is lost. After four failures in ten seconds it gives up and the field merges on save. Each recovery is counted in the inspector and sent as a browser event:

js
window.addEventListener('filament-collaboration:recovered', ({ detail }) => {
    // detail: { field, error, key, selection, doc, at, room }
    Sentry.captureMessage(`Editor recovered: ${detail.error}`, { extra: detail })
})

To log a warning on the server with the document and selection it failed on, ready to replay, turn on reportEditorErrors(). The log then holds field contents, so enable it only where that is acceptable. It is limited to fields the user can write, and 20 reports per user an hour.

Released under the MIT License.