You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
There should be a "View Source URL" link for each evidence on a promise, in the timeline section. It seems to be missing for all promises. It should appear below the evidence description at the bottom of this screenshot:
There is a 2-month logic that basically checks selectedEvent.sourceUrl and renders the link if it is present. The selectedEvent is tied to the evidence type and not the promise.
Recently, a change was made to render the sourceUrl as label instead of View Source text
I believe the missing source_url from the JSON is a data issue. Once that is fixed, we can fix the rendering label to show View Source instead of the URL.
@githubedward is right about it being a data issue. The function that builds the component is looking for a source_url from an evidences item but you can see in our api at https://www.buildcanada.com/tracker/api/v1/evidences that there is no source_url as part of evidences params.
const evidenceEvents: TimelineDisplayEvent[] =
promise?.evidences?.map((evidence) => {
// Create a brief description for the timeline node (max 60 chars)
const briefDescription = evidence.title;
return {
id: `ev-${evidence.id}`,
type: "evidence" as const,
date: evidence.published_at || new Date().toISOString(),
title: briefDescription, // Brief description for the node
fullTitle: evidence.title,
fullText: evidence.summary,
sourceUrl: evidence.source_url,
// evidenceSourceType: item.evidence_source_type, // Pass the source type
};
}) || [];
events.push(...evidenceEvents);
@melkuo based on your screenshot it looks like there is a URL under entries. Can you confirm if source_url is coming from the evidence object or the entry object?
If it’s in entries, we’ll need to either update the frontend to pull from the correct place or adjust the API to include source_url in the evidence payload.
I'm in the process of verifying if the source_url exists in our entries however when I try to access https://www.buildcanada.com/tracker/api/v1/entries the server times out. @xrendan is this just on my end?
@xrendan looks like our seed data and live prod data are not in sync. I don't get anything when I hit localhost:3000/entries, activities, evidences but do on https://www.buildcanada.com/tracker/api/v1/activities. Can confirm that I have `localhost:3000/promises and departments seeding properly.
Thanks @verrixkio! I can confirm from looking at the production admin that all entries seem to have a url. I presume that the evidence source_url would be always be the same, so either of your solutions work.
On #3, I can confirm also never been able to get entries, activities and evidences populated on my local cc @xrendan
The issue is not fixed yet. This thread contains all the latest findings. Specifically, @verrixkio 's comment on July 29 is the latest as I understand it. Would be awesome if you could dig in from there!
@xrendan I saw your latest changes for including the source_url to the promises.
Just to confirm, this issue for the source_url of the evidence? I think i found the root cause last weekend but didn't get time to dig deeper to confirm & test my changes.
This issue is a bit hard to reproduce on dev/local env since we doesn't have evidence seed and what's seed for the promises under commitment_history_rationale doesn't include source_url values.
I'll try to finish this today and submit a PR soon
With the current view, i'm able to get the URL from a dummy evidence. Like i said on the previous comment, there is currently no evidences, activities and entries seed.
@xrendan Like i said in the previous comment, without any changes, the API call return the URL after creating dummy evidence, activity and entry via the admin panel.
My suggestion for change was based on which URL is wanted either the activity URL or the actual entry URL.
If you want the activity url -> current code would work
If you want the entry url -> json.source_url evidence.activity.entry.url
Since there no seed for these entities in LOCAL and i don't have access to the PROD or DEV env, i can't really debug further with only a local instance. If you make a updated db dump of PROD with all the relevant entities, it would be easier to debug in local imo.
Currently with dummy data created via the admin, your current code should work well if the source_url field of the activity is defined and associated to the evidence.
My quick guess is that the source_url in activity is not properly defined.
For a quick fix, we access the entry url instead of the activity source_url since we have the url for the entry but doesn't have the source_url set for the activity
Activity
githubedward commentedon Jul 18, 2025
Looks like this issue is caused by
source_urlset tonullmelkuo commentedon Jul 19, 2025
@githubedward perhaps the URL is not being passed through or it should be referencing another field?
I do see it on Entries
melkuo commentedon Jul 20, 2025
githubedward commentedon Jul 22, 2025
Two things to note here:
selectedEvent.sourceUrland renders the link if it is present. TheselectedEventis tied to the evidence type and not the promise.sourceUrlas label instead ofView SourcetextSee file reference
I believe the missing
source_urlfrom the JSON is a data issue. Once that is fixed, we can fix the rendering label to showView Sourceinstead of the URL.thomas-hul commentedon Jul 29, 2025
Taking a look into this
thomas-hul commentedon Jul 30, 2025
https://www.buildcanada.com/tracker/api/v1/evidencesthat there is no source_url as part of evidences params.@melkuo based on your screenshot it looks like there is a URL under entries. Can you confirm if source_url is coming from the evidence object or the entry object?
If it’s in entries, we’ll need to either update the frontend to pull from the correct place or adjust the API to include source_url in the evidence payload.
I'm in the process of verifying if the source_url exists in our entries however when I try to access
https://www.buildcanada.com/tracker/api/v1/entriesthe server times out. @xrendan is this just on my end?@xrendan looks like our seed data and live prod data are not in sync. I don't get anything when I hit localhost:3000/entries, activities, evidences but do on https://www.buildcanada.com/tracker/api/v1/activities. Can confirm that I have `localhost:3000/promises and departments seeding properly.
melkuo commentedon Jul 30, 2025
Thanks @verrixkio! I can confirm from looking at the production admin that all entries seem to have a url. I presume that the evidence source_url would be always be the same, so either of your solutions work.
On #3, I can confirm also never been able to get entries, activities and evidences populated on my local cc @xrendan
thomas-hul commentedon Aug 1, 2025
@melkuo Got it, I'll pull it from the entries object when I refactor the frontend to fetch it, so no DB changes needed. Should have a PR soon.
maxnorm commentedon Sep 23, 2025
Hi yall,
can i get a clear explanation & update of this issue? Was it finally fix on the front-end or not?
As what i'm understanding, we are missing source_url data when fetching the evidences from the API.
Just want to know more before proposing a fix.
Thanks
melkuo commentedon Sep 24, 2025
The issue is not fixed yet. This thread contains all the latest findings. Specifically, @verrixkio 's comment on July 29 is the latest as I understand it. Would be awesome if you could dig in from there!
xrendan commentedon Oct 2, 2025
maxnorm commentedon Oct 5, 2025
@xrendan I saw your latest changes for including the
source_urlto the promises.Just to confirm, this issue for the
source_urlof the evidence? I think i found the root cause last weekend but didn't get time to dig deeper to confirm & test my changes.This issue is a bit hard to reproduce on dev/local env since we doesn't have evidence seed and what's seed for the promises under
commitment_history_rationaledoesn't includesource_urlvalues.I'll try to finish this today and submit a PR soon
maxnorm commentedon Oct 5, 2025
The current evidence view work well?
After creating a dummy evidence, activity & entry linked to the promise at ID 1, this is what i get from the API:
Endpoint:
/promises/1.jsonIt's getting the Activity
source_urlrelated to the evidence.We can return the URL of the entry instead with this:
With the current view, i'm able to get the URL from a dummy evidence. Like i said on the previous comment, there is currently no
evidences,activitiesandentriesseed.Let me know your thought on what's next.
xrendan commentedon Oct 16, 2025
@maxnorm sorry for missing this. Would you be able to make a PR for that fix?
maxnorm commentedon Oct 18, 2025
@xrendan Like i said in the previous comment, without any changes, the API call return the URL after creating dummy
evidence,activityandentryvia the admin panel.My suggestion for change was based on which URL is wanted either the activity URL or the actual entry URL.
If you want the activity url -> current code would work
If you want the entry url ->
json.source_url evidence.activity.entry.urlSince there no seed for these entities in LOCAL and i don't have access to the PROD or DEV env, i can't really debug further with only a local instance. If you make a updated db dump of PROD with all the relevant entities, it would be easier to debug in local imo.
Currently with dummy data created via the admin, your current code should work well if the
source_urlfield of the activity is defined and associated to the evidence.My quick guess is that the
source_urlin activity is not properly defined.For a quick fix, we access the entry
urlinstead of the activitysource_urlsince we have the url for the entry but doesn't have thesource_urlset for the activity