Commit graph

1684 commits

Author SHA1 Message Date
Joe
9912d86896 Refactor file path handling in JobThreadContext and ApiService
- Streamlined the logic for encoding new file names and paths, enhancing consistency in file operations across both JobThreadContext and ApiService.
- Improved readability by consolidating multiple lines of code into single statements, particularly in the handling of metadata file paths and script suffixes.
- Enhanced error logging for snapshot retrieval in compute_and_apply_changes, ensuring better debugging capabilities during file operations.
2026-02-05 20:35:34 -06:00
Joe
e33cf7ae77 Refactor file renaming logic in JobThreadContext to improve path encoding
- Updated the renaming logic to utilize encoded path names for both directories and files, ensuring compatibility with encoded names and improving accuracy in file handling.
- Enhanced comments for clarity on the naming resolution process, particularly in relation to script suffixes and metadata file management.
- Improved the overall robustness of file path operations during instance updates, addressing potential issues with name resolution.
2026-02-05 20:32:41 -06:00
Joe
033d8c6892 Refine adjacent meta file removal logic in ApiService
- Updated the logic for removing adjacent meta files to correctly derive base names by stripping known script suffixes, improving accuracy in file handling.
- Enhanced comments for clarity on the naming resolution process, ensuring better understanding of the changes made to file paths during sync operations.
2026-02-05 20:12:31 -06:00
Joe
6ce3717663 Complete integration tests for two-way sync operations
- Marked all planned integration tests for the two-way sync functionality as completed, ensuring coverage for critical operations such as source property writes, property persistence, instance renames, and lifecycle management.
- Added a new test module specifically for two-way sync, enhancing overall test coverage and reliability of the sync system.
- Updated the change processor to handle file path overrides during instance updates, improving the accuracy of source writes and file management.
2026-02-05 19:51:14 -06:00
Joe
06d296ffba Enhance two-way sync functionality and integration test coverage
- Improved the two-way sync pipeline by refining instance renaming logic, ensuring correct handling of directory-format scripts and adjacent meta file renaming.
- Enhanced property persistence for non-Source properties, ensuring proper creation of meta files during updates.
- Introduced comprehensive integration tests for critical two-way sync operations, including instance renames, ClassName transitions, and end-to-end workflows, addressing previously uncovered scenarios.
- Updated logging for better insights during sync operations and file handling, aiding in debugging and user awareness of changes.
2026-02-05 19:19:34 -06:00
Joe
dc1a912982 Enhance model file conversion logic in ApiService
- Improved handling of .model.json5 files during conversion to init.meta.json5, ensuring compatibility by extracting only supported fields and warning about potential data loss from inline children.
- Updated the script renaming process to derive base names from filesystem paths, preserving character encoding and improving consistency in metadata file naming.
- Enhanced logging to provide clearer warnings and context during file operations, aiding in debugging and user awareness of changes.
2026-02-05 19:05:49 -06:00
Joe
e6944e3132 Refactor file renaming logic in JobThreadContext and improve path handling
- Simplified the logic for resolving the actual file to rename, consolidating the handling of directory and file paths.
- Enhanced the script renaming process to ensure correct naming conventions based on class type, improving clarity and consistency.
- Updated logging to provide better insights during class name changes and file renaming operations, aiding in debugging.
- Made minor formatting adjustments to improve code readability in the `suppressed_paths` method and API service file handling.
2026-02-05 18:52:10 -06:00
Joe
f38c96e12b Add init file discovery in JobThreadContext and enhance script renaming logic
- Introduced a new method `find_init_file` to locate the first `init.*.luau` or `init.*.lua` file within a directory-format script folder.
- Updated the script renaming logic to handle directory-format scripts correctly by renaming the init file instead of the directory itself.
- Enhanced logging to provide warnings when no init file is found, improving debugging capabilities during class name changes.
- Adjusted related file handling to ensure proper file path management during script transitions.
2026-02-05 18:46:43 -06:00
Joe
f4f07744c7 Refactor suppression mechanism for file watcher events
- Updated the suppression logic for file watcher events to use a HashMap instead of a HashSet, allowing for count-based suppression. Each API write increments the count, while each suppressed VFS event decrements it.
- Introduced a new method to register paths in the suppression map, improving the handling of redundant re-snapshots and WebSocket messages.
- Enhanced logging for suppressed events to provide better context during debugging.
- Adjusted related structures and methods across ChangeProcessor, ServeSession, and ApiService to accommodate the new suppression mechanism.
2026-02-05 18:46:36 -06:00
Joe
0968e74208 Implement comprehensive fixes for sync system issues
- Introduced a new plan to address eight identified issues in the sync system, including improvements to standalone script handling, property persistence, and file watcher behavior.
- Key changes include extracting standalone-to-directory conversion logic, enhancing property update persistence, and implementing a recovery mechanism for rapid delete+recreate scenarios.
- Added integration tests to ensure coverage for each fix and improve overall system reliability.
- Enhanced logging for VFS events to aid in debugging file watcher desynchronization issues.

This commit significantly improves the robustness of the sync system and addresses critical issues identified in the audit.
2026-02-05 18:25:47 -06:00
Joe
4a03d4bab5 Refactor serve tests to use recv_socket_packet for file operations
- Replaced direct file operations with the new recv_socket_packet method in multiple test functions to ensure WebSocket listeners are active before changes are made.
- This change helps avoid race conditions and improves the reliability of test outcomes by ensuring that actions triggering file changes are executed after the WebSocket connection is established.
2026-02-05 17:12:07 -06:00
Joe
b1aa2a384f Improve error handling in TestServeSession for Rojo process
- Enhanced the error handling logic when the Rojo process exits unexpectedly by capturing and displaying stderr output. This provides better context for debugging failures during test execution.
- Updated the process spawning to pipe stderr, allowing for more informative panic messages when the process fails.
2026-02-05 16:13:09 -06:00
Joe
df06fd0852 Add sleep duration in serve tests for stability
- Introduced a 100ms sleep in multiple test functions to ensure stability during file operations and socket packet retrieval.
- This change aims to mitigate timing issues that may arise from rapid file changes and improve the reliability of test outcomes.
2026-02-04 15:59:19 -06:00
Joe
74205206d5 update 2026-02-04 15:11:08 -06:00
Joe
1e92d36dac Upgrade notify crate from v4 to v8 with stress tests
- Update notify dependency from 4.0.18 to 8.2

- Add notify-debouncer-full 0.7 for event debouncing

- Rewrite StdBackend to use new debouncer API and EventKind system

- Add 13 stress tests including undo/redo simulation

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-04 15:10:02 -06:00
Joe
da320e36eb Enhance ancestry node handling in PatchTree
- Added logic to create a placeholder node when an ancestor object is missing from both instanceMap and patch.added, allowing the ancestry chain to maintain integrity during rapid changes.
- Improved logging to provide context when a placeholder node is created, enhancing debugging capabilities.
2026-02-04 14:42:34 -06:00
Joe
a1dfc2b7ef Implement atomic file writing for sourcemaps
- Added a new `write_atomic` function to ensure sourcemaps are written to a temporary file before renaming, preventing file watchers from reading incomplete data.
- Enhanced error handling during file operations with context-aware messages for better debugging.
- Updated `write_sourcemap` to utilize the atomic write method, improving reliability and safety during sourcemap creation.
2026-02-03 17:34:31 -06:00
Joe
69f35c1c05 Enhance PatchVisualizer component for improved height management
- Updated `DomLabel` to synchronize element height immediately when parent re-renders, preventing incorrect positioning by the VirtualScroller.
- Refactored `PatchVisualizer` to store height bindings by node ID, ensuring persistent bindings across re-renders and eliminating visual glitches for expanded rows.
- Implemented cleanup logic for unused node height bindings, optimizing memory usage and performance.
2026-02-02 18:25:49 -06:00
Joe
2379f5bce0 Refactor error handling in retry logic for file operations
- Improved readability of the retry logic in `write_with_retry` and `remove_file_with_retry` functions by formatting the condition for determining whether to retry on specific OS errors. This change enhances code clarity while maintaining existing functionality.
2026-02-02 18:11:28 -06:00
Joe
4fdf562fba Enhance syncback performance with parallel file operations
- Improved syncback performance by parallelizing filesystem writes using rayon, allowing file writes and removals to run concurrently while maintaining sequential directory operations.
- Implemented retry logic for file and directory operations on Windows to handle transient errors, enhancing reliability during syncback processes.
2026-02-02 18:10:57 -06:00
Joe
d99e918e55 Enhance TextInput and ConfirmingPage layout
- Added textXAlignment property to TextInput for customizable text alignment.
- Updated ConfirmingPage to set textXAlignment to Left and adjusted size and position of the TextInput, improving layout and user experience.
2026-02-02 17:55:12 -06:00
Joe
e124d8a227 Enhance TextInput and filtering functionality in ConfirmingPage
- Added support for onChanged event in TextInput to handle real-time text updates.
- Updated ConfirmingPage to utilize onChanged for filter input, improving user interaction.
- Refactored wildcard matching function in PatchVisualizer to support case-insensitive substring matching, enhancing filtering capabilities.
2026-02-02 17:51:52 -06:00
Joe
c092bb975c Add filter functionality to PatchVisualizer and ConfirmingPage
- Implemented a case-insensitive wildcard matching function in PatchVisualizer to filter visible nodes based on user input.
- Enhanced the ConfirmingPage to include a TextInput for filtering, allowing users to search for specific nodes in the PatchVisualizer.
- Updated the rendering logic to display appropriate messages based on the filter state, improving user experience and clarity.
2026-02-02 15:34:08 -06:00
Joe
ff96d98d79 Suppress output during git index refresh in syncback
- Updated the `refresh_git_index` function to redirect both stdout and stderr to null, preventing unnecessary output during the execution of the `git update-index --refresh` command. This change enhances the user experience by reducing clutter in the console logs.
2026-02-02 14:25:21 -06:00
Joe
dddab62ea1 Refactor git index refresh logic in syncback
- Simplified the `refresh_git_index` function by removing the retry mechanism and directly handling the exit code of the `git update-index --refresh` command. Now, it logs a warning only if the command fails to execute, improving clarity and reducing unnecessary complexity.
2026-02-02 14:24:54 -06:00
Joe
d4ae0820bc Implement retry logic for git index refresh in syncback
- Enhanced the `refresh_git_index` function to include a retry mechanism for the `git update-index --refresh` command, allowing for up to two attempts with a 500ms delay between retries in case of failure. This improves robustness in handling transient errors during the refresh process.
2026-02-02 14:21:40 -06:00
Joe
d5522b2fef update rules 2026-02-02 14:05:11 -06:00
Joe
4c390fdd37 Add syncback reminder for initialized projects
- Introduced a message prompting users to run 'rojo syncback' if a place ID is specified during project initialization, enhancing user guidance and workflow clarity.
2026-02-02 13:06:39 -06:00
Joe
10c73c60ea setup template project better 2026-02-02 12:52:28 -06:00
Joe
1bf32f0920 Update references to UserGeneratedLLC in documentation and enhance project file specifications
- Changed all instances of `rojo-rbx` to `UserGeneratedLLC` in the rbx-dom and rojo documentation to reflect the new repository ownership.
- Updated project file format specifications to prioritize `.project.json5` over `.project.json`, clarifying the preferred file extensions and their usage.
- Revised syncback documentation to reflect changes in file extensions from `.lua` to `.luau`, ensuring consistency across the project.
- Improved clarity in the API and communication architecture documentation, emphasizing the new structure and endpoints.
2026-02-02 12:27:08 -06:00
Joe
e6efc04756 rules 2026-02-02 12:08:47 -06:00
Joe
a9b4f8e83b Enhance Lua static analysis guidelines in ci.md
- Updated the Selene section to emphasize the importance of achieving zero errors and warnings, marking it as critical.
- Added detailed instructions for fixing common Selene issues immediately, ensuring compliance before proceeding.
- Clarified the reporting format for Selene and Clippy results to reflect the requirement for zero issues.
- Reinforced the importance of not reporting an overall PASS unless all linters pass with zero issues.
2026-02-01 22:15:30 -06:00
Joe
09a0f95d53 Refactor stress test files to enhance clarity and performance
- Removed unnecessary references to LargeTreeGenerator in multiple stress test files, streamlining the code.
- Simplified loop iterations by replacing index variables with underscores for unused values, improving readability.
- Updated the diff logic in the reify and diff tests to eliminate unused patch variables, enhancing performance and clarity.
- Ensured consistent formatting across stress test files for better maintainability.
2026-02-01 22:14:59 -06:00
Joe
d513ab16c0 Refactor stress test files for improved readability and functionality
- Simplified the reify stress test by consolidating the reifyInstance call into a single line for better clarity.
- Added a cleanup function in the stressPatterns test to manage knownIds, ensuring that IDs of destroyed instances are removed.
- Enhanced the logic for adding, removing, and updating instances in the stressPatterns test to verify the existence of parent and child instances before operations, improving test robustness.
- Reformatted code in LargeTreeGenerator and MockApiContext for consistency and readability.
2026-02-01 22:10:18 -06:00
Joe
01110fc916 Complete comprehensive plugin tests and add new stress test files
- Marked all todos in the comprehensive_plugin_tests plan as completed, indicating that all planned tests have been implemented.
- Introduced new stress test files for InstanceMap, PatchSet, and encoding functionalities, covering various scenarios including large batch operations, conflict resolution, and deep/wide hierarchies.
- Enhanced the testing framework to ensure thorough validation of plugin functionalities and edge cases.
2026-02-01 22:05:27 -06:00
Joe
180e1f9078 Update zmij package version to 1.0.19 in Cargo.lock 2026-02-01 21:15:54 -06:00
Joe
bb423312aa Refine testing philosophy and success criteria in comprehensive_plugin_tests plan
- Updated the testing philosophy to emphasize investigation of failing tests, clarifying that failures may indicate either code bugs or invalid tests.
- Revised success criteria to focus on analyzing failing tests rather than skipping them, ensuring a thorough understanding of test outcomes.
- Enhanced documentation on failure triage and anti-patterns to avoid, promoting a more robust approach to quality assurance in testing.
2026-02-01 21:13:52 -06:00
Joe
5298664bad Remove NetworkClient from visibleServices in multiple snapshot test files 2026-02-01 21:05:00 -06:00
Joe
76e4bc4f25 Add Int64 conversion functions to EncodedValue.lua and enhance script middleware selection in project.rs
- Implemented int64FromPod and int64ToPod functions for converting between Lua numbers and msgpack Int64 representation, addressing precision concerns for large integers.
- Updated the middleware_for_script function to determine the correct script directory based on the RunContext property, improving middleware selection for Script instances.
- Adjusted syncback logic to utilize the new middleware selection for Scripts, ensuring accurate handling of different script types during project synchronization.
2026-02-01 20:51:13 -06:00
Joe
04cf9ac91d Remove NetworkClient from VISIBLE_SERVICES in syncback module 2026-02-01 20:22:57 -06:00
Joe
44344f4014 Refactor syncback logic for camera removal handling
- Simplified the logic for removing the current camera by using a default value for sync_current_camera, improving code readability.
- Enhanced the handling of camera references within the syncback loop, ensuring that the camera is only removed when explicitly set to do so.
- Updated comments for clarity on the default behavior regarding camera removal in the syncback process.
2026-02-01 20:21:24 -06:00
Joe
fe2bf358e7 Enhance syncback logic for orphan file handling and improve test coverage
- Updated the syncback process to prevent scanning the project root folder, ensuring that unrelated files like .gitignore and README.md are not deleted.
- Introduced functionality to collect alternate file representations for paths, allowing orphan files to be identified and removed correctly.
- Enhanced the logic for handling ignored paths, particularly for directories, to improve accuracy in clean mode operations.
- Updated tests to reflect changes in orphan file handling, ensuring that only orphans within $path directories are removed, and clarified documentation regarding clean mode behavior.
2026-02-01 20:18:45 -06:00
Joe
411f79ee81 Enhance syncback functionality and improve code readability
- Refactored the syncback process to streamline directory management and improve handling of class transitions in clean mode.
- Updated the `clone_tree_filtered` function to accept a tuple of compiled Globs and original pattern strings, enhancing flexibility in ignore pattern handling.
- Simplified logic for checking if paths are inside removed directories, improving code clarity.
- Added detailed comments to clarify the purpose of new logic for handling script directory transitions, ensuring better maintainability.
- Improved logging for better traceability during syncback operations.
2026-02-01 20:10:11 -06:00
Joe
1534a54808 Refactor syncback process to improve clean mode handling and directory management
- Removed the ensure_project_paths_exist function, streamlining the syncback process by directly managing directory creation and cleanup within the syncback command.
- Enhanced error handling for sourcemap generation, logging warnings when clean mode removes directories that only contain meta files.
- Updated the logic for middleware selection in clean mode to better handle directory and script transitions based on the filesystem structure.
- Added utility functions to ensure base project directories exist before syncback, addressing the need for directory structure in clean mode.
- Improved test coverage for clean mode scenarios, ensuring that directory existence checks are performed and documented.
2026-02-01 19:55:54 -06:00
Joe
1f476d6cc9 Enhance syncback documentation and optimize clean mode functionality
- Added detailed explanations of clean mode, its purpose, and benefits, clarifying its role in achieving an accurate filesystem state.
- Updated the syncback process to include scanning of the project folder for orphan removal, ensuring comprehensive path collection.
- Emphasized the importance of understanding expected outputs before modifying code in response to failing tests, reinforcing testing philosophy.
2026-02-01 19:29:42 -06:00
Joe
2e6f909a71 Fix syncback process to handle directory paths and class transitions in clean mode
- Resolved an issue where syncback failed for projects with `$path` pointing to single files by ensuring only directory paths are scanned for orphans.
- Implemented a function to create missing directories in clean mode, allowing restoration of deleted directories.
- Enhanced class transition handling in clean mode to allow recoverable transitions between Folder and Script types.
- Updated logging and error handling to improve clarity during the syncback process.
2026-02-01 19:27:53 -06:00
Joe
fe1ac1dd95 Fix bugs in syncback process and enhance error handling
- Resolved issues with nested orphan file removal, ensuring that both top-level and nested orphan files are correctly handled.
- Improved directory removal logic to gracefully handle cases where directories may have already been removed, preventing crashes.
- Enhanced the path scanning algorithm to accurately collect all source directories defined in the project, addressing missing paths in the syncback process.
- Updated logging to provide clearer debug information during directory scanning and error handling in the syncback operations.
2026-02-01 19:14:12 -06:00
Joe
4a66eff938 Add comprehensive syncback roundtrip and clean mode stress tests
- Completed the implementation of roundtrip tests to validate the syncback process, ensuring that building a project, syncing back, and rebuilding produces semantically identical outputs.
- Created a new utility module for roundtrip testing, including functions for running builds and asserting directory equality.
- Developed clean mode stress tests to verify that syncing back to a dirty directory yields identical results to syncing back to a fresh directory, covering various mutation scenarios.
- Updated existing test modules to incorporate new test cases and ensure consistency in handling standalone scripts transitioning to directory format when children are added.
2026-02-01 19:01:42 -06:00
Joe
17d250f26a Add comprehensive Lua plugin stress testing plan
- Introduced a new testing plan for comprehensive Lua plugin stress tests, covering edge cases, large-scale scenarios, and abuse testing.
- Detailed todos for creating various test modules, including diff, apply, reify, property handling, encoding, and integration tests.
- Emphasized the importance of testing for concurrent workflows and error recovery in the plugin architecture.
2026-02-01 18:43:45 -06:00
Joe
b95b28179f Update LocalScript references in syncback format transition tests
- Changed references from `init.client.luau` to `init.local.luau` in the test for directory LocalScript to accurately reflect the script type being tested.
- Updated assertions to match the new file naming convention, ensuring consistency in the test's expectations for standalone files.
2026-02-01 18:35:22 -06:00