WildcatIP / other.js

The Chatternet feature platform
GNU Affero General Public License v3.0
7 stars 1 forks source link

Replace UPDATE_FEATURE_METADATA with FETCH_FEATURE_METADATA #180

Open kharmabum opened 7 years ago

kharmabum commented 7 years ago

Presently if some feature A requires the metadata/manifest for a feature B at a particular URL, feature A relies on the embedder having previously emitted UPDATE_FEATURE_METADATA with the metadata for feature B. This is slightly awkward for a few reasons:

  1. The embedder has to broadcast any feature metadata it knows about to all running features, which duplicates that data across those feature contexts and requires the embedder to update that data to prevent it from going stale.
  2. Requesting arbitrary feature metadata is not supported - feature A is limited to accessing metadata of features that the embedder happened to have metadata for, prior to feature A's request

The proposal here is to remove UPDATE_FEATURE_METADATA from UserAgent and replace it with FETCH_FEATURE_METADATA on the Environment emitter. The embedder would respond by either immediately returning known metadata for the requested feature or by fetching the feature source, assembling the metadata, and returning it to the requesting sandbox.