nextcloud / nextcloud/spreed

Do not provide Public API frontend events for private

Open
#16,698 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature: frontend 🖌️ technical debt
Dominant language
JavaScript
Stars
2.2k
Forks
586
Avg merge
18h 27m
Merged PRs (30d)
333

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Problem

We often use @nextcloud/event-bus internally to trigger an action or change a state from one module to another.

Events in @nextcloud/event-bus are acts as Public API: they are stored in a global namespace (potential name conflicts) and used for inter-app communication (potential unexpected breaking change).

This can lead to one app breaking another in cases of:

  • Event name conflict (especially general names like show-settings without namespace prefix)
  • Breaking change from using private API
TODO
  • Check which events are actually required to be public
  • For public events make sure they have talk: prefix for namespacing to avoid conflicts and deprecate old event name
  • For private events — remove them from public API:
    • Use explicit communication: modules, function calls, application state
    • In the worst case: migrate to the local event bus
Current public events
  • talk:unread:update - ✅ public, only used by Talk Desktop indirectly (but required a change)
  • talk:media-settings:show - ⚠️ private
  • talk:media-settings:hide - ⚠️ private
  • spreed:select-active-sidebar-tab - ⚠️ private
  • switch-screen-to-id - ?
  • send-reaction - ?
  • show-settings - ?
  • show-conversation-settings - ?
  • hide-conversation-settings - ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by auditing the listed @nextcloud/event-bus events: talk:unread:update, talk:media-settings:show/hide, spreed:select-active-sidebar-tab, and the unnamed events. Determine which are required to remain public, then identify private-event callers and choose explicit communication or the local event bus for them. Done means public events are namespaced and private events are no longer exposed through the public API.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.