Stories + Sprints: create() re-fetches by placeholder SID, triggers Method-not-found banner #142

Closed
opened 2026-04-22 15:53:41 +00:00 by zaelgohary · 0 comments
Member

StoryService::create and MilestoneService::create both follow this shape:

let new_obj = self.new_obj().await?;   // returns { sid: "0000", ... } placeholder
obj.sid = new_obj.sid;
self.save(&obj).await?;                 // server assigns and returns a real SID, discarded
self.get(&obj.sid.as_str()).await       // refetch by "0000" → server responds -32601 "Method not found"

After a successful save the UI shows a red "Network error: RPC error [-32601]: Method not found" banner even though the record was created. The ProjectService::create path does the right thing (captures the saved SID from save() and refetches by that); the other two services were missed.

Fix: capture the String that save() returns and pass it to get().

`StoryService::create` and `MilestoneService::create` both follow this shape: ```rust let new_obj = self.new_obj().await?; // returns { sid: "0000", ... } placeholder obj.sid = new_obj.sid; self.save(&obj).await?; // server assigns and returns a real SID, discarded self.get(&obj.sid.as_str()).await // refetch by "0000" → server responds -32601 "Method not found" ``` After a successful save the UI shows a red "Network error: RPC error [-32601]: Method not found" banner even though the record was created. The `ProjectService::create` path does the right thing (captures the saved SID from `save()` and refetches by that); the other two services were missed. Fix: capture the `String` that `save()` returns and pass it to `get()`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_archipelagos#142
No description provided.