Talent-Catalog / talentcatalog

https://tctalent.org
GNU Affero General Public License v3.0
10 stars 4 forks source link

Bug: Candidate Opp title string too long, preventing SF record creation #1271

Open samschlicht opened 4 weeks ago

samschlicht commented 4 weeks ago

An interesting little bug here: I can instantly see the cause but will have to think about how we fix it.

Yousef is adding candidates to the submission list for this Job but the corresponding SF Candidate Opps aren't being created. Looking at our logs, it's clear the Job has a very long title to begin with — subsequently, when the candidate name and number are prepended per our naming convention, the resulting string is too long for SF to accept it as a Candidate Opp title:

Screenshot 2024-08-15 at 11.32.18 AM.png

Reported by Yousef on the #tool-salesforce channel: Slack Message

samschlicht commented 4 weeks ago

Okay, implemented a simple solution that works — anything over 120 characters, I truncate to 117 and append '...' to indicate missing text:

Screenshot 2024-08-15 at 1.28.01 PM.png

Wondering if this should be a hot fix?

camerojo commented 4 weeks ago

@samschlicht

Rather than a hot fix, why not change change the job name?

As for a more permanent fix, I think that we add validation to ensure that names do not get too long rather than truncating.

I changed the names for now and got it working for Yousef.

samschlicht commented 3 weeks ago

UPDATE: John edited the name directly, which has solved the immediate issue — I'd had the notion but was concerned there would be other unwanted effects.

Copied from Slack, where I replied to John's Q:

The problem is we’re still creating the job opps on SF, and we can’t edit the validation for the ‘name’ field. As mentioned above, I wouldn’t want to edit the candidate name and number. The only additional suggestion I’d make is adding some help text to that field on SF, suggesting brevity. But I think our only option for truncation is the candidate opp title set on the TC.

samschlicht commented 3 weeks ago

We've decided to defer the code fix for this issue to our next release, V2.3.0. I've closed the attached PR but left it connected as a potential future solution, once we've considered the alternatives.

In the unlikely event this comes up again, the suggested fix is to edit the candidate opp name directly in the DB.

Putting back in the Product Backlog and marking for V2.3.0