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
{{ message }}
Repository navigation
[HOLD for payment 2024-06-28] [HOLD for payment 2024-06-24] [$250] [TS Migration] Define a concise way to access or default to an inexistent record #39125
changed the title [-][TS Migration] Define a concise way to access or default to an inexistent record[/-][+][HOLD TS migration completion] [TS Migration] Define a concise way to access or default to an inexistent record[/+]on Mar 28, 2024
Currently we have been defaulting nullable entity IDs to either 0 or -1 when it doesn’t exist as we can see here and here (and many other files throughout the project). The lack of conciseness when defaulting such IDs leads to confusion between developers and increased chance of bugs.
Solution
Standartise the default values of all Onyx entity IDs. Personally I think we should default all nullable entity IDs to -1 as it is a negative ID and theoretically we would never have a negative one in the DB (@mountiny makes sense to you?):
For each Onyx type inside src/types/onyx/, look for properties that ends with ID?: ..., e.g. managerID?: number;, parentReportID?: string;, iouReportID?: string; inside Report.ts
For each property, look for its usage throughout the codebase.
If that property is being defaulted to either 0 or -1, change it to -1.
Change TS_STYLE.md to include this advice of using -1 to default these kind of ID properties.
changed the title [-][HOLD TS migration completion] [TS Migration] Define a concise way to access or default to an inexistent record[/-][+][TS Migration] Define a concise way to access or default to an inexistent record[/+]on Apr 16, 2024
@fabioh8010 this makes sense to me, but I think we need to bring this up to slack for broader agreement, can you post the proposal to open source channel before proceeding?
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@jjcoffee] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
[@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.
changed the title [-][HOLD for payment 2024-06-24] [$250] [TS Migration] Define a concise way to access or default to an inexistent record[/-][+][HOLD for payment 2024-06-28] [HOLD for payment 2024-06-24] [$250] [TS Migration] Define a concise way to access or default to an inexistent record[/+]on Jun 21, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.85-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@jjcoffee] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
[@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
[-][TS Migration] Define a concise way to access or default to an inexistent record[/-][+][HOLD TS migration completion] [TS Migration] Define a concise way to access or default to an inexistent record[/+]fabioh8010 commentedon Apr 16, 2024
Problem
Currently we have been defaulting nullable entity IDs to either
0or-1when it doesn’t exist as we can see here and here (and many other files throughout the project). The lack of conciseness when defaulting such IDs leads to confusion between developers and increased chance of bugs.Solution
Standartise the default values of all Onyx entity IDs. Personally I think we should default all nullable entity IDs to
-1as it is a negative ID and theoretically we would never have a negative one in the DB (@mountiny makes sense to you?):src/types/onyx/, look for properties that ends withID?: ..., e.g.managerID?: number;,parentReportID?: string;,iouReportID?: string;inside Report.ts0or-1, change it to-1.TS_STYLE.mdto include this advice of using-1to default these kind of ID properties.[-][HOLD TS migration completion] [TS Migration] Define a concise way to access or default to an inexistent record[/-][+][TS Migration] Define a concise way to access or default to an inexistent record[/+]mountiny commentedon Apr 16, 2024
@fabioh8010 this makes sense to me, but I think we need to bring this up to slack for broader agreement, can you post the proposal to open source channel before proceeding?
fabioh8010 commentedon Apr 17, 2024
@mountiny Sure, I can post! But could you make this issue External? It was marked as External initially.
84 remaining items
melvin-bot commentedon Jun 17, 2024
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[-][HOLD for payment 2024-06-24] [$250] [TS Migration] Define a concise way to access or default to an inexistent record[/-][+][HOLD for payment 2024-06-28] [HOLD for payment 2024-06-24] [$250] [TS Migration] Define a concise way to access or default to an inexistent record[/+]melvin-bot commentedon Jun 21, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.85-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-06-28. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 21, 2024
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
johncschuster commentedon Jun 24, 2024
Discussing in Slack to make sure I'm understanding the correct payment date
johncschuster commentedon Jun 25, 2024
@jjcoffee do we need a regression test for this? If so, can you propose the steps?
johncschuster commentedon Jun 25, 2024
Payment Summary:
Contributor: @kubabutkiewicz - does not require payment
Contributor+: @jjcoffee - $250 - paid via Upwork - PAID
jjcoffee commentedon Jun 26, 2024
@johncschuster No I don't think so, since this is an app-wide change.
johncschuster commentedon Jun 26, 2024
Awesome. Thank you!