Skip to content
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

fix: update audit table API permissions so unpublished routes can render PlanningConstraints #2392

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

jessicamcinchak
Copy link
Member

@jessicamcinchak jessicamcinchak commented Nov 7, 2023

August flagged this morning that on /unpublished routes, PlanningConstraints are failing to render correctly & throwing the following console error:

{
 "extensions": {
    "path": "$.selectionSet.insert_planning_constraints_requests_one",
    "code": "validation-failed"
  },
  "message": "field "insert_planning_constraints_requests_one" not found in type: 'mutation_root'"
}

Before: https://editor.planx.uk/barnet/find-out-if-you-need-planning-permission/unpublished
After: https://2392.planx.pizza/barnet/find-out-if-you-need-planning-permission/unpublished

Changes:

  • Update planning_constraints_requests table to grant the api role select permissions, consistent with other audit tables, as this is necessary for the insert_ mutation to return the new record's id
  • Adjust frontend conditional rendering so in cases of an error, that's all we ever display - never a mix of error plus successful roads response like happened in this edge case

This bug is only effecting /unpublished routes, not /preview, so no particular rush to deploy

Copy link

github-actions bot commented Nov 7, 2023

🤖 Hasura Change Summary compared a subset of table metadata including permissions:

Updated Tables (1)

  • public.planning_constraints_requests permissions:

    insert select update delete
    api
    5 added column permissions
    insert select update
    api ➕ created_at
    ➕ destination_url
    ➕ id
    ➕ response
    ➕ session_id

Copy link

github-actions bot commented Nov 7, 2023

Removed vultr server and associated DNS entries

@jessicamcinchak jessicamcinchak changed the title fix: unpublished routes are failing to return PlanningConstraints because of audit table permissions fix: update audit table API permissions so unpublished routes can render PlanningConstraints Nov 7, 2023
@jessicamcinchak jessicamcinchak marked this pull request as ready for review November 7, 2023 13:12
@jessicamcinchak jessicamcinchak requested a review from a team November 7, 2023 13:12
@DafyddLlyr
Copy link
Contributor

Thanks for picking this one up!

@jessicamcinchak jessicamcinchak merged commit 3a64aef into main Nov 7, 2023
12 checks passed
@jessicamcinchak jessicamcinchak deleted the jess/unpublished-constraints-audit-bug branch November 7, 2023 13:59
@DafyddLlyr DafyddLlyr mentioned this pull request Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants