Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Refactored topic structure for more granular flow and access (#…
…652) * WIP: topics list * Set topics as strings for custom String.formatStr * Remove vestigial vio publishing * Refactor arena-camera to use SCENE_CAMERA topic - Move query selects to ready if possible - Partially init topic on ready, use live camName - use global ARENA * Consolidate user camera and user hand topics * Refactor arena-hand to use SCENE_USER topic - Consolidate this.arena to just global ARENA * Refactor mqtt and worker to use defined topics - Once again simplify this.arena to just use ARENA global - Pass subscriptions list instead of renderTopic TODO: Last will is still set to delete just the camera object, we need to add support for this new /x/ user presence subtopic keyed on user id * Refactor out renderTopic, used prev for write check We now assume that a user who has write access can do so to any public topic message category. * Restore config "realm" into topic templates * Set entity attr for new `private` top level param * Refactor aabb collider for new topics - Dispatches event msgs to one of 3 possible destination topics: 1. public user 2. private to the collided entity itself 3. private to the collided entity's program designation * Refactor gesture-detector for new scene topic - fix: Use camName not 'my-camera' for object_id - Init vars for topic, camera pos alias * Refactor click-listener with new topics * Refactor collision listener topics * Refactor ar-hit-test-listener topics - Set 'object_id' as 'scene' * Add nonuser offset for renderpriv and debug topics * Use new ns/scene scoped debug topic * Refactor UI card, buttons, text-input topics * Update facetracker topic TODO: Add face_{idTag} pub perm * Refactor build3d publish topics * Cleanup unused outputTopic, etc * Refactor chat topics * Add reusable ARENA.topicParams * Refactor mesh/plane publisher * Refactor apriltag publish, set priv env topic * Update runtime topics * Refactor build topic publishes * fix: Topic to/from order for scene - This DIFFERS from chat (pending rework of chat channels) - The users own id is always token in positional index 5 * fix: var name for sceneObj private * Add positional tokens to topic constants * Use defined positional tokens in mqtt topic split * Add topic uuid validation for json msgs on worker - only applicable for json msgs - use `uuid`, `topicUuid` for consistency - Remove now redundant main thread validation for create/update/delete * Don't validate chat topics on worker - Chat currently has a different positional structure vs scene, TBD if its worth declaring separate token sets or just leave this one off in the chat system msg handler * Consolidate camName into idTag - We already know a camera is a camera by object_type in data, the camera is implicitly the "main" object representation of a user - This removes the duality of maintaining and targeting both `camera_IDTAG` object vs the idTag of a user. - This greatly simplifies topics as result - We still keep username and display name separate * Add getUsernameFromIdTag util * Consolidate chat under scene context - This constrains chat msgs and presence to scene vs namespace, an improvement in privacy - Chat no longer requires explicit subs, inherits default pub/private subscriptions from general scene - As camName is deprecated, this gives both topic source validation on `(objectId === idTag)` as well as `toUid`'s solely limited to `idTag`. The corresponding to/from msg fields are no longer explicitly required (and no longer spoofable as well) - Message and queue handler validation now can be customized on field name, default is still `object_id` * Add private scene presence topic - This should replace the announce-to-all behavior when a new user joins (such that announces scale at n vs n^2) * WIP: start splitting chat and presence - Set out pub and priv chat and presence topics - client lastwill now will announce to /x/ - remove interval keepalive - remove onconnect and disconnect callbacks in chat - Rename some callbacks names to reflect jitsi * WIP: Dispatch sceneMsg handler by scenemsg type - Wire chat, user and scene obj handlers - TODO: handle /x/ msgs (put in chat.js or...?) * Add SCENE_MSGTYPES to constants * Default cameras to TTL in 30s This should remove ghost clients that fail to lastwill * Add presence message handling, cleanup chat - Consolidate liveUserList updates - Presence 'leave' now triggers object delete/blip - All arena-cameras now default to 30s ttl - All camera updates extend presence expiration and displayname - Remove vestigial scene checks in chat * fix: various chat/mqtt/components - Update displayname on setting change - add object_id -> id remap for user msghandler - bind callback in init - delete with delete handler - specify user types in outgoing presence msg - move self announce join after username set - Remove call to deprecated connect in chat - handle undef global ARENA in topics - topic constant - rename callback initialized to isReady This collides with AFRAME internal initialized bool for components used to track dependency states - add referenced components as dependencies * fix: query selector for dep * Remove btoa suffix on chat idTag * There is no try, only do * fix: typod var for scenename * remove unused imports * Cleanup ARENA and cameraName refs in jitsi * Further remove un, consolidate as dn in chat - username is given by topic object_id - displayname is what should be text rendered all the time * fix: properly handle userlist update from jitsi * fix: ttl single property per doc examples * fix: chat msg payload * fix: chat touid/displayname * fix: loadsceneobjs call new scene obj handlers * revert: don't set component deps - Based on AFRAME behavior, this assumes these components will be set on the same el, which is not intended behavior * fix: delay topics set for box collide * Handle program_id object flags * refactor: all clientEvent message structure - object_id is always the actor, either the user idTag, or a hand. - data.source is deprecated, since it's implicit and ACL controlled as the object_id - data.position is ambiguous and thus deprecated, no longer required field - data.target is always the target object ID - data.targetPosition is always the relevant position on the target object - data.originPosition is always the actor's position * Update clientEvent handler * fix: typo * Add private and program_id to build schema * fix: consistency of ttl usage * Use timestamp instead of additl from_time field * fix: imports for build * Add private and program_id fields to build schemas * Add formatStr proto func for build/main * Update device pub/sub topics * update client rest urls for new account api * adding some notes for refactor @EdwardLu2018 * update build ui check with topic template * update topics todos * fixed isUsersPermitted using old topics * fix build3d MutiationObserver this.TopicBase scope crash * enable chat/message ui with jwt check * fix errors in user presense permission checks * also disable chat in build3d * lint/format: autofix * fix: typo on privPres pub topic * Add MQTT_SUBSCRIBED event for sensitive msg timing * fix: proxied func can't be in obj * lint update * fix(build): fixed incorrect ns/scene ids * fix(build): identify build client on mqtt bus * Move JITSI_EVENTS.CONNECTED to arena eventmanager - This should be a one-time thing that happens, which may result in a race condition as seen in the chatui * fix chat display from merge * fix: ttl schema usage, time-extending behavior * Add jitter to arena-camera TTL to force update() * Revert previous ttl schema with nested seconds - This should always trigger an update from aframe lifecycle - Removes need to jitter arena-camera ttl value * Add description note for TTL re: top level prop * update build subscribe to new schema * render fusion draft * update remote render pub/sub * update clientEvent and it's deprecated fields * update screenshare for non-owners * update docs with new topics * add temp subs for render fusion * fixes ttl seconds expression, all consumers and producers are expecting ttl: 30 and not ttl: { seconds: 30 } * object program id tags no longer required * feat: runtime mngr using new topics * fix: remove tmp formatStr definition * cleanup logging --------- Co-authored-by: mwfarb <mwfarb@andrew.cmu.edu> Co-authored-by: Nuno Pereira <nampereira@gmail.com>
- Loading branch information