Skip to content

Commit e453236

Browse files
committed
fix activity history extract activity id
1 parent 51e604a commit e453236

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/apps/answers/flow_submission_progress.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ def __init__(self, session: AsyncSession, answer_session: AsyncSession):
2222

2323
@staticmethod
2424
def _extract_activity_id(activity_history_id: str) -> str:
25-
"""Extract activity_id from activity_history_id format: {activity_id}_{version}."""
26-
return activity_history_id.split("_")[0]
25+
"""Extract activity_id from activity_history_id format: {activity_id}_{version}.
26+
27+
Activity history ID format is: UUID (36 chars) + "_" + version
28+
Example: "cf6b7fd3-203c-4d4a-b9fb-91ccae37146b_1.0.0"
29+
"""
30+
return activity_history_id[:36]
2731

2832
async def load(self, flow_history_id: str, submit_id) -> None:
2933
"""Load flow structure and existing submissions for the submit id."""
@@ -33,7 +37,8 @@ async def load(self, flow_history_id: str, submit_id) -> None:
3337
return
3438

3539
flow_history = flow_histories[0]
36-
self._expected_counts = Counter(item.activity_id for item in flow_history.items)
40+
# Extract UUID from activity_history_id format for counting
41+
self._expected_counts = Counter(self._extract_activity_id(item.activity_id) for item in flow_history.items)
3742
self._expected_ids = set(self._expected_counts.keys())
3843
self._has_flow_history = True
3944

0 commit comments

Comments
 (0)