-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Allow custom fields to be editable for system objects and prevent the error for timeline activity on system object pages. #16268
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
base: main
Are you sure you want to change the base?
Conversation
…r system objects with a details page
Greptile OverviewGreptile SummaryThis PR fixes two critical issues preventing custom field editing on system object detail pages: timeline activity query errors and optimistic cache sorting crashes. Key Changes:
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant SystemObjectPage
participant useTimelineActivities
participant TimelineActivityMetadata
participant GraphQLQuery
participant RecordField
participant turnSortsIntoOrderBy
participant sortCachedObjectEdges
User->>SystemObjectPage: Open calendar event details page
SystemObjectPage->>useTimelineActivities: Request timeline activities
useTimelineActivities->>TimelineActivityMetadata: Check if field exists for target object
alt Field exists (noteTarget, taskTarget)
TimelineActivityMetadata-->>useTimelineActivities: Field found
useTimelineActivities->>GraphQLQuery: Execute query with skip=false
GraphQLQuery-->>SystemObjectPage: Return timeline activities
else Field doesn't exist (calendarEvent, etc)
TimelineActivityMetadata-->>useTimelineActivities: Field not found
useTimelineActivities->>GraphQLQuery: Skip query (skip=true)
GraphQLQuery-->>SystemObjectPage: Return empty array (no error)
end
User->>RecordField: Edit custom field on calendar event
RecordField->>turnSortsIntoOrderBy: Generate orderBy for cache update
alt Object has position field
turnSortsIntoOrderBy-->>RecordField: [...sorts, {position: AscNullsFirst}]
else Object without position field
turnSortsIntoOrderBy-->>RecordField: [...sorts, {id: AscNullsFirst}]
end
RecordField->>sortCachedObjectEdges: Sort cached edges with orderBy
Note over sortCachedObjectEdges: orderBy[0] is guaranteed to exist
sortCachedObjectEdges-->>RecordField: Sorted edges (no crash)
RecordField-->>User: Field updated successfully
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
27 files reviewed, no comments
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:6429 This environment will automatically shut down when the PR is closed or after 5 hours. |

Solves #16015
useTimelineActivities.tsto see if the system object page we're viewing has timelineActivity being tracked before querying to get the activity history.useTimelineActivities.tshook displays timeline activity as empty for the time - error would not be shown as suggested by Thomas.