CivicTechTO / CivicTechTO/toronto-bids
ariba: understand the popup-menu state machine — point fixes regress at scale (#174)
- Dominant language
- Python
- Stars
- 7
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Follow-up from #174 / PR #182. The per-file capture archived 37 of 39 documents on `Doc5713434353`; these two were recorded in `Doc5713434353.omitted.json` rather than silently dropped.
**`schedule-b2.pdf`** — the lone document in a *second* popup-menu container (`_vn9ot`). `_ensure_clickable` re-opens the `References` sections, which reaches the 35-item container but not this one, so the anchor stays in the DOM and never becomes visible:
```
schedule-b2.pdf: its control is in the DOM but not visible, and re-opening the
References sections did not reveal it — refusing to click something that is not
on screen (#174)
```
**`Part 2 - Construction Agreement_A1.pdf`** — a `PML` tree link like Parts 1 and 3, which both capture fine. It has failed twice with *different* errors, which suggests something specific to that row rather than to the mechanism:
- run 5: `the menu did not open within 15s (no VISIBLE 'Download this attachment' among 3 candidates)`
- run 6: `neither its DOM id nor any unclaimed link of that name is in the content tree`
**Why this is low priority.** The failure is honest — both are named in the durable gap record, and the capture is 37/39. Worth a look next time the event page is open in a browser anyway; not worth a dedicated live run.
**Where to start:** `AribaFileSource._ensure_clickable` and `_locate_by_handle` in `scrapers/toronto_bids/sources/ariba_attachments.py`. Note the documented trap — a second blind click on an already-open `References` control *collapses* it, so any fix must be evidence-based rather than clicking again.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with AribaFileSource._ensure_clickable and _locate_by_handle in scrapers/toronto_bids/sources/ariba_attachments.py, then trace how popup-menu containers and PML tree links are located. Investigate both omitted documents and the documented collapse trap without blindly reopening an already-open References control. Done means an evidence-based fix handles these cases without regressing the other 37 captures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100