Skip to content

Conversation

AMoreaux
Copy link
Contributor

No description provided.

… synchronization enhancements

- Added `lastViewedAt` as a redis-backed field for better tracking user interactions with the `company` object.
- Implemented Redis support in `workspace-select-query-builder` and supporting ORM logic (e.g., `redisFieldSqlFactory`, `redisFieldsDataSource`, `redisFieldRepository`).
- Enhanced `graphql-query-parser` to compute redis-driven fields dynamically in listings.
- Updated metadata cache to handle synthetic redis-backed metadata fields, avoiding duplication.
- Extended test cases to validate new field integrations and behavior adjustments.
- Refactored `redis-client.service` to support a no-eviction Redis client.
…lastViewedAt` storage in Redis

- Introduced `OBJECT_RECORD_VIEWED_EVENT` for tracking object record views.
- Optimized `lastViewedAt` field handling by removing legacy synthetic metadata injection.
- Refactored frontend `RecordShowPage` with reusable `RecordShowContent` for enhanced component structure.
- Enhanced Redis-backed field storage with accurate timestamp conversion logic.
@AMoreaux AMoreaux requested a review from FelixMalfait October 13, 2025 16:45
@AMoreaux AMoreaux self-assigned this Oct 13, 2025
@AMoreaux AMoreaux changed the title feat(): add recently view on company feat(lastViewAt): add recently view on company Oct 13, 2025
# Conflicts:
#	packages/twenty-server/src/engine/api/graphql/graphql-query-runner/graphql-query-parsers/graphql-query-order/graphql-query-order.parser.ts
#	packages/twenty-server/src/engine/api/graphql/graphql-query-runner/resolvers/graphql-query-find-many-resolver.service.ts
…t parameters

- Corrected indentation issues in `graphql-query-find-many-resolver.service.ts` for better readability.
- Removed unused boolean parameters in `graphql-query.parser.spec.ts` to maintain cleaner tests.
Copy link
Contributor

github-actions bot commented Oct 13, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:47580

This environment will automatically shut down when the PR is closed or after 5 hours.

# Conflicts:
#	packages/twenty-front/src/pages/object-record/RecordShowPage.tsx
#	packages/twenty-server/src/engine/api/graphql/graphql-query-runner/resolvers/graphql-query-find-many-resolver.service.ts
settings: {
displayFormat: DateDisplayFormat.RELATIVE,
},
storage: 'redis',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would have used isVirtualField: boolean and then but the storage within the settings JSONB
Because as discussed we will have virtual fields on Postgres storage

// Skip non-persisted redis-backed fields: company.lastViewedAt
if (
flatObjectMetadata.standardId === STANDARD_OBJECT_IDS.company &&
flatFieldMetadata.standardId === COMPANY_STANDARD_FIELD_IDS.lastViewedAt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is temporary code and is already obvious for you, but this would need to be refactored into something more generic

}, [record, setRecordStore, loading]);

useEffect(() => {
eventTracker(AnalyticsType.TRACK, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already track pageviews, can't we infer it from that or do something smarter rather than send 2 extremely similar track events?
We could either stop tracking unstructured pageviews and only store events like that ; or we could eventually let the endpoint support an array and send 2 events at once...? I think I prefer solution 1

@@ -0,0 +1,5 @@
export const wrapperWithDoubleQuoteWhenUpperCase = (value: string) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we always add quotes? I know we don't add much comments in the codebase but maybe it's worth adding one here because it's not clear to me which we cannot always add quotes and get rid of this function entirely

…nhance GraphQL query parsing

- Removed unused `RecordShowContent` component to streamline frontend logic.
- Improved GraphQL query parser by replacing `orderBy` logic with more extensible `addOrderBy` handling.
- Added support for external storage aliasing in order-by conditions for better compatibility with composite fields.
Copy link
Contributor

TODOs/FIXMEs:

  • // TODO: dirty. Avoid using replace on regex: packages/twenty-server/src/engine/api/graphql/graphql-query-runner/graphql-query-parsers/graphql-query.parser.ts

Generated by 🚫 dangerJS against a57c4f0

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