GCTC-NTGC / gc-digital-talent

GC Digital Talent is the new recruitment platform for digital and tech jobs in the Government of Canada. // Talents numΓ©riques du GC est la nouvelle plateforme de recrutement pour les emplois numΓ©riques et technologiques au gouvernement du Canada.
https://talent.canada.ca
GNU Affero General Public License v3.0
22 stars 8 forks source link

πŸ› Can't add a new work experience #11749

Open maxneuvians opened 1 week ago

maxneuvians commented 1 week ago

πŸ› Bug

After the update last night I can no longer add Work Experience to my profile. I get an error back from the GraphQL endpoint:

{
    "errors": [
        {
            "message": "Variable \"$id\" of non-null type \"ID!\" must not be null.",
            "locations": [
                {
                    "line": 1,
                    "column": 36
                }
            ]
        }
    ]
}

Specifically I tried to add a certification experience. I can still edit existing experience however.

πŸ¦‹ Expected Behaviour

A new work experience should be added

πŸ•΅οΈ Details

πŸ“‹ Steps to Reproduce

  1. Add a new work experience
  2. Fill in details
  3. Submit

πŸ“Έ Screenshot

image

πŸ™‹β€β™€οΈ Proposed Solution

βœ… Acceptance Criteria

esizer commented 1 week ago

@tristan-orourke I think this was an issue with a null coalescing operator change we recently made. We use the same form for adding and editing, if we have an ID we expect it to be editing an experience and run that mutation.

We were passing in an empty string if we had no ID which will not fall through ?? but would for ||. So it saw the empty string and tried passing that which graphql treats as null.

This was fixed recently in https://github.com/GCTC-NTGC/gc-digital-talent/pull/11719

We will need to test to confirm, but I bneleive this was the issue and has been fixed just not deployed yet.

https://github.com/GCTC-NTGC/gc-digital-talent/blob/62e91d475ab8d72281817bf7cb5a9f2c2b1fa64f/apps/web/src/pages/Profile/ExperienceFormPage/ExperienceFormPage.tsx#L685

https://github.com/GCTC-NTGC/gc-digital-talent/blob/62e91d475ab8d72281817bf7cb5a9f2c2b1fa64f/apps/web/src/pages/Profile/ExperienceFormPage/ExperienceFormPage.tsx#L325

tristan-orourke commented 1 week ago

Thank you for reporting this @maxneuvians, it was very helpful! We've rolled back the problematic release for now.