fix: removing file read operations to avoid state change #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The chat breaks after editing a user story because a
ReadFile
is performed, which updates theselectedFileContent
in the global state. This was added to read the updated content and update the user story component accordingly. However, this action overwrites theselectedFileContent
, which is supposed to hold the PRDxx-base.json content, with the PRDxx-feature.json content. When navigating to the Task page, it tries to access therequirement
attribute from the PRDxx-base.json content in theselectedFileContent
. Due to the overwrite, the requirement attribute becomes undefined, causing the chat to break as the payload's attribute is undefined. This PR fixes this issue.Type of Change
Pre-flight Checklist
Screenshots
Additional Notes