diff --git a/plugin/src/ApiContext.lua b/plugin/src/ApiContext.lua index eb61d372..999f8cb7 100644 --- a/plugin/src/ApiContext.lua +++ b/plugin/src/ApiContext.lua @@ -8,6 +8,7 @@ local HttpError = require(script.Parent.HttpError) local ApiContext = {} ApiContext.__index = ApiContext +-- TODO: Audit cases of errors and create enum values for each of them. ApiContext.Error = { ServerIdMismatch = "ServerIdMismatch", } diff --git a/plugin/src/Http.lua b/plugin/src/Http.lua index 5323ee3e..19383b7e 100644 --- a/plugin/src/Http.lua +++ b/plugin/src/Http.lua @@ -13,6 +13,7 @@ local function dprint(...) end end +-- TODO: Factor out into separate library, especially error handling local Http = {} function Http.get(url) diff --git a/plugin/src/Main.server.lua b/plugin/src/Main.server.lua index 6cdd9725..e2c50be3 100644 --- a/plugin/src/Main.server.lua +++ b/plugin/src/Main.server.lua @@ -45,6 +45,8 @@ local function main() local currentSession + -- TODO: More robust session tracking to handle errors + -- TODO: Icon! toolbar:CreateButton("Connect", "Connect to Rojo Session", "") .Click:Connect(function() checkUpgrade() diff --git a/plugin/src/Session.lua b/plugin/src/Session.lua index d55a9e0e..1d0e6d30 100644 --- a/plugin/src/Session.lua +++ b/plugin/src/Session.lua @@ -11,8 +11,8 @@ function Session.new() setmetatable(self, Session) + -- TODO: Rewrite all instance tracking logic and implement a real reconciler local created = {} - created["0"] = game:GetService("ReplicatedFirst") local api diff --git a/server/src/file_route.rs b/server/src/file_route.rs index 3bd3b38e..ba972bb7 100644 --- a/server/src/file_route.rs +++ b/server/src/file_route.rs @@ -2,6 +2,8 @@ use std::path::{Path, PathBuf, Component}; use partition::Partition; +// TODO: Change backing data structure to use a single allocation with slices +// taken out of it for each portion #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct FileRoute { pub partition: String, diff --git a/server/src/message_session.rs b/server/src/message_session.rs index 7f2c840f..7dd1ccb4 100644 --- a/server/src/message_session.rs +++ b/server/src/message_session.rs @@ -9,9 +9,6 @@ pub enum Message { InstanceChanged { id: Id, }, - Error { - message: String - }, } #[derive(Clone)] diff --git a/server/src/rbx_session.rs b/server/src/rbx_session.rs index bd2045b8..39b1952f 100644 --- a/server/src/rbx_session.rs +++ b/server/src/rbx_session.rs @@ -9,6 +9,8 @@ use session::SessionConfig; use vfs_session::{VfsSession, FileItem, FileChange}; use message_session::{Message, MessageSession}; +// TODO: Rethink data structure and insertion/update behavior. Maybe break some +// pieces off into a new object? fn file_to_instances( file_item: &FileItem, partition: &Partition, @@ -81,6 +83,8 @@ fn file_to_instances( output.get_mut(&child_id).unwrap().parent = Some(primary_id); changed_ids.push(child_id); + + // TODO: Should I stop using drain on Vecs of Copyable types? for id in child_changed_ids.drain(..) { changed_ids.push(id); } @@ -99,6 +103,7 @@ pub struct RbxSession { message_session: MessageSession, /// The RbxInstance that represents each partition. + // TODO: Can this be removed in favor of instances_by_route? partition_instances: HashMap, /// The store of all instances in the session. @@ -153,6 +158,7 @@ impl RbxSession { self.message_session.push_messages(&messages); }, FileChange::Deleted(route) => { + // TODO: Handle deletion of children here and in Moved case. match self.instances_by_route.get(route) { Some(id) => { self.instances.remove(id); diff --git a/server/src/web.rs b/server/src/web.rs index 1d172c6f..16cc9ae1 100644 --- a/server/src/web.rs +++ b/server/src/web.rs @@ -128,6 +128,8 @@ pub fn start(config: WebConfig) { }) }, + // TODO: API to read only specific instances + _ => rouille::Response::empty_404() ) });