Feature - maker broker able to pre-process state updates

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript

Research direction

Start by tracing how the broker receives state updates from IframeSyncClient instances and compares them with stored state. Define the configurable preprocessing callback and verify that canonicalized equivalent updates do not trigger further client notifications; no files or tests are named in the issue.

Written by the indexing model from the issue text.

Description

When you have two IframeSyncClients sending state with trivial differences, let's say one likes to pass a certain value as a number, and the other sends it as a string, you can get into situations where they end up endlessly fighting. The broker could help solve such issues by creating a "canonical state" from what it gets sent.

For example, if client A sends:

{
  "value": 10
}

Then client B sends:

{
  "value": "10"
}

The broker could preprocess that state, converting it to the canonical state before comparing it to what it already had stored internally. It would then see that the update actually changes nothing, so the clients do not need to be informed of a state change. This preprocess step would be configurable with a user-provided callback; the broker code itself would not decide what the true state should be.

Dominant language
JavaScript
Stars
0
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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.

More from mieweb/iframe-sync

All issues in mieweb/iframe-sync

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.