-
-
Notifications
You must be signed in to change notification settings - Fork 4
fix: refresh resume extract previews #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4914,6 +4914,39 @@ async def test_reprocess_confirmation_view_calls_reprocess_preview( | |
| == "🔄 Reprocessing resume and extracting profile fields now..." | ||
| ) | ||
|
|
||
| @pytest.mark.asyncio | ||
| async def test_run_resume_extract_and_preview_uses_refresh_token_for_reprocess( | ||
| self, crm_cog, mock_interaction | ||
| ): | ||
| """Explicit reprocess actions should bypass cached extract jobs.""" | ||
| crm_cog._enqueue_resume_extract_job = AsyncMock(return_value="job-123") | ||
| crm_cog._wait_for_backend_job_result = AsyncMock( | ||
| return_value={ | ||
| "status": "succeeded", | ||
| "result": {"success": False, "error": "boom"}, | ||
| } | ||
| ) | ||
| crm_cog._build_resume_extract_debug_file = Mock(return_value=Mock()) | ||
| crm_cog._audit_command = Mock() | ||
|
|
||
| with patch( | ||
| "five08.discord_bot.cogs.crm.uuid4", | ||
| return_value=Mock(hex="refresh-token-123"), | ||
| ): | ||
|
Comment on lines
+4932
to
+4935
|
||
| await crm_cog._run_resume_extract_and_preview( | ||
| mock_interaction, | ||
| contact_id="contact123", | ||
| contact_name="Candidate User", | ||
| attachment_id="resume123", | ||
| filename="candidate.pdf", | ||
| link_member=None, | ||
| action="crm.reprocess_resume", | ||
| status_message="🔄 Reprocessing resume and extracting profile fields now...", | ||
| ) | ||
|
|
||
| kwargs = crm_cog._enqueue_resume_extract_job.await_args.kwargs | ||
| assert kwargs["refresh_token"] == "refresh-token-123" | ||
|
|
||
| @pytest.mark.asyncio | ||
| async def test_build_match_candidates_posting_fetches_jd_links_from_text( | ||
| self, jobs_cog | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_extract_header_locationskips any header line containing the substring "remote" before attempting to parse bullet-separated candidates. With the new bullet/fragment parsing, a line like "Toronto, Ontario ○ remote" would now be skipped entirely even though a valid location fragment exists; consider moving the "remote" filter to the per-candidate loop (or only skipping when the whole line is just a remote marker) so trailing OCR bullet text doesn’t suppress a valid location.