Commit graph

1896 commits

Author SHA1 Message Date
Joe
dd3466b225 Implement unsuppress_path method in JobThreadContext for better VFS event handling
- Added a new `unsuppress_path` method to the `JobThreadContext` to remove suppressions on paths when filesystem operations fail, ensuring that future events for those paths are processed correctly.
- Updated various sections of `change_processor.rs` to call `unsuppress_path` in relevant error handling scenarios during rename and write operations, improving the accuracy of event processing.
- Enhanced the logic for managing suppressed paths, contributing to a more robust change processing mechanism in the VFS.
2026-02-06 11:23:31 -06:00
Joe
6fd9037cd1 Add stress tests for VFS and Change Processor under maximum load
- Introduced a comprehensive suite of stress tests targeting various combinations of rename, ClassName changes, and source updates to evaluate the robustness of the VFS and Change Processor.
- Implemented multiple test cases that simulate rapid, concurrent operations with zero wait times, ensuring the system can handle high-pressure scenarios without race conditions.
- Enhanced the existing test framework to support fire-and-forget operations, validating the correct handling of file existence and metadata updates after intensive changes.
- Documented the purpose and structure of the new tests to clarify their role in stress testing the two-way sync functionality.
2026-02-06 10:41:46 -06:00
Joe
78143bae4d Add path suppression for VFS events in JobThreadContext
- Implemented a new `suppress_path` method to prevent re-processing of file-watcher events triggered by the ChangeProcessor, enhancing event handling during renames and writes.
- Updated various sections of the `change_processor.rs` file to call `suppress_path` for relevant paths during rename operations, ensuring accurate metadata synchronization and preventing unnecessary processing.
- Enhanced the logic for updating instance metadata to maintain consistency after filesystem path changes, improving the robustness of the change processing mechanism.
2026-02-06 09:55:54 -06:00
Joe
9bed6dfaa2 Complete todos for stress tests and add syncback_stress fixture
- Marked all todos in the stress test plan as completed, including the implementation of timing helpers, a PRNG, and various fuzz tests for two-way sync operations.
- Introduced a new `syncback_stress` fixture with a project configuration and multiple Luau modules (Alpha, Bravo, Charlie, Delta, Echo) to support stress testing.
- Enhanced the `api.rs` file with improved path handling logic for better integration with the stress testing framework.
2026-02-05 22:36:19 -06:00
Joe
f2f5e01a87 Enhance path handling for init files in ApiService
- Updated logic in `api.rs` to correctly handle cases where existing paths are init files, ensuring that children are placed in the appropriate directory.
- Improved clarity in comments to explain the handling of init files and their relationship to directory structure, contributing to better maintainability of the code.
2026-02-05 22:05:56 -06:00
Joe
bc77b26f07 Enhance stress tests and path handling for two-way sync
- Expanded the stress test plan to include file watcher stress tests alongside existing randomized fuzzing and deterministic tests, improving coverage of the two-way sync functionality.
- Updated todos to reflect the addition of filesystem polling helpers and a FuzzState tracker for better test management.
- Refined path handling in `api.rs` to ensure encoded names are consistently used across file operations, enhancing filesystem safety and reliability during syncback processes.
- Improved documentation in the rojo rules to clarify the long-term goals and current state of the two-way sync strategy, emphasizing the need for feature parity with the existing CLI syncback command.
2026-02-05 22:02:37 -06:00
Joe
df729a871e Add stress tests for two-way sync functionality
- Introduced a new plan for nuclear-grade stress tests and randomized fuzzing for two-way sync operations, focusing on rapid multi-cycle operations and race conditions.
- Created a comprehensive set of todos for implementing timing helpers, a deterministic PRNG, and various fuzz tests to validate the robustness of the two-way sync mechanism.
- Enhanced existing infrastructure in `two_way_sync.rs` to support new testing strategies, including the addition of a `FuzzState` tracker and `run_fuzz_iteration` helper for managing randomized operations.
- Updated `change_processor.rs` and `api.rs` to improve path handling and suppression logic, ensuring accurate event processing during stress tests.
2026-02-05 21:49:59 -06:00
Joe
206ffd3720 Refactor path handling in tests for encoded names consistency
- Consolidated multiple lines of code into single statements for improved readability in test cases related to encoded names.
- Updated the logic in various tests to ensure consistent handling of file paths, particularly for encoded module and script names.
- Enhanced clarity in test assertions by streamlining path construction, contributing to better maintainability and understanding of the test suite.
2026-02-05 21:26:18 -06:00
Joe
5b2ea2a23f Refactor file path handling in JobThreadContext to support combined rename and ClassName changes
- Updated the logic to use the effective file path when handling script-to-script transitions, ensuring that the correct path is used even after a rename operation.
- Enhanced the test suite with a new test case for combined rename and ClassName changes, verifying that the extension change is applied correctly after a file rename.
- Improved comments for clarity on the renaming process and its implications for file handling during updates.
2026-02-05 21:19:18 -06:00
Joe
9c92204956 Add syncback_encoded_names fixture and related tests for encoded name handling
- Introduced a new fixture `syncback_encoded_names` with various scripts and models demonstrating encoded characters in names, including `What%QUESTION%Module` and `Key%COLON%Script`.
- Added tests to validate the correct handling of encoded names during directory conversions, ensuring that the filesystem names match the expected encoded formats.
- Updated `change_processor.rs` and `api.rs` to improve file handling and metadata management related to encoded names, enhancing overall robustness and consistency in operations.
2026-02-05 21:12:06 -06:00
Joe
1edca38c34 Add directory name derivation functions in ApiService for improved file handling
- Introduced `dir_name_from_script_path` and `dir_name_from_instance_path` functions to derive directory names from script and instance paths, respectively, enhancing consistency in file operations.
- Updated the `convert_standalone_script_to_directory` and related methods to utilize the new functions for accurate directory naming, ensuring proper handling of various script suffixes.
- Added comprehensive unit tests for the new functions to validate their behavior across different file types and edge cases, improving overall test coverage and reliability.
2026-02-05 21:02:39 -06:00
Joe
e6121a651c Refactor file handling in JobThreadContext and ApiService for improved metadata management
- Updated the logic for deriving file names in JobThreadContext to utilize encoded base names from filesystem paths, enhancing consistency and preserving character encoding.
- Enhanced ApiService to differentiate between model files and other file types, ensuring correct handling of in-place updates and adjacent meta file creation for unsupported formats.
- Improved logging for property persistence operations, providing clearer insights during file updates and enhancing debugging capabilities.
2026-02-05 20:50:33 -06:00
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