Skip to content

feat: [FEEDS-1667] Regenerate from OpenAPI with translation support - #305

Merged
itsmeadi merged 6 commits into
mainfrom
FEEDS-1667
Jul 16, 2026
Merged

itsmeadi merged 6 commits into
mainfrom
FEEDS-1667

Conversation

@itsmeadi

@itsmeadi itsmeadi commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Ticket

Summary

Regenerates @stream-io/feeds-client from the latest feeds-clientside-api.yaml to pick up FEEDS-1651 translation support: language / translate_text query params on feed and comment read endpoints, translateActivity / translateComment methods, and i18n fields on activity/comment responses.

Adds a docs snippet integration test (translation.test.ts) aligned with the customer translation docs page.

Checklist

  • The changed code has been covered with unit tests
  • API endpoints are covered with client tests
  • The internal documentation (./docs) has been updated

Notes for review

  • Depends on FEEDS-1651 backend/OpenAPI in chat (already merged).
  • Customer docs JS snippets updated in docs-content#1429.
  • Unit tests pass locally: yarn workspace @stream-io/feeds-client test:unit
  • Version bump/release via workflow after merge.

Made with Cursor

Summary by CodeRabbit

  • Tests
    • Added integration coverage for the Translation page, including translating seeded activity content into French and projecting it for Spanish with expected i18n fields.
    • Verified translate_text behavior for Spanish, ensuring translated text and i18n.language metadata are present.
    • Added coverage for updating a user’s language preference and confirming it takes effect.
    • Skipped a flaky Stories Feed event test to reduce intermittent failures.
  • Chores
    • Updated CI to run docs code snippet tests before the React tutorial deployment step.

Add language/translate_text query params, translateActivity/translateComment
endpoints, and i18n fields from the FEEDS-1651 OpenAPI spec. Includes a
docs snippet test for the translation feature page.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bb77d0f7-4030-4fba-b19a-c59a9f15343d

📥 Commits

Reviewing files that changed from the base of the PR and between 576f2bc and 9f05f0b.

📒 Files selected for processing (1)
  • packages/feeds-client/__integration-tests__/docs-snippets/translation.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/feeds-client/integration-tests/docs-snippets/translation.test.ts

📝 Walkthrough

Walkthrough

Adds translation integration tests for activity translation, language projection, translated text substitution, and user language updates, with feed cleanup and CI execution of documentation snippet tests. A flaky stories test is skipped due to intermittent event timeouts.

Changes

Translation integration tests

Layer / File(s) Summary
Test setup and lifecycle
packages/feeds-client/__integration-tests__/docs-snippets/translation.test.ts
Initializes the test client, feed, and seeded activity, then deletes the feed and disconnects the user after the suite.
Translation behavior coverage
packages/feeds-client/__integration-tests__/docs-snippets/translation.test.ts
Tests French activity translation, Spanish language projection, Spanish text substitution with translation enabled, and updating the user language preference to English.
Documentation snippet CI execution
.github/workflows/lint-test.yml
Runs documentation code snippet tests after package tests and before the Vercel deployment step.

Stories test stability

Layer / File(s) Summary
Flaky stories test handling
packages/feeds-client/__integration-tests__/stories.test.ts
Skips the direct-read stories feed test and documents intermittent timeouts waiting for the feed update event.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: isekovanic, arnautov-anton

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description has ticket, summary, checklist, and notes, but it does not follow the required template sections for Overview and Implementation notes. Reformat the PR description to use the template headings and add concise content under Overview and Implementation notes, plus the docs link if relevant.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: regenerating the feeds client from OpenAPI to add translation support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch FEEDS-1667

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/feeds-client/__integration-tests__/docs-snippets/translation.test.ts`:
- Line 20: Import the Node.js crypto module in the translation test before its
use in the feed initialization expression, so the existing crypto.randomUUID
call resolves explicitly across supported Node.js versions.
- Around line 21-27: Remove the watch: true option from the feed.getOrCreate
call in the translation test, leaving the default non-watching behavior so
addActivity does not emit an unawaited WebSocket event.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9e7d8370-8284-4ebf-bcd0-fc04e6675b82

📥 Commits

Reviewing files that changed from the base of the PR and between 88b2478 and b2f3c37.

⛔ Files ignored due to path filters (5)
  • packages/feeds-client/src/gen/feeds/FeedApi.ts is excluded by !**/gen/**
  • packages/feeds-client/src/gen/feeds/FeedsApi.ts is excluded by !**/gen/**
  • packages/feeds-client/src/gen/model-decoders/decoders.ts is excluded by !**/gen/**
  • packages/feeds-client/src/gen/models/index.ts is excluded by !**/gen/**
  • packages/feeds-client/src/gen/moderation/ModerationApi.ts is excluded by !**/gen/**
📒 Files selected for processing (1)
  • packages/feeds-client/__integration-tests__/docs-snippets/translation.test.ts

beforeAll(async () => {
client = createTestClient();
await client.connectUser(user, createTestTokenGenerator(user));
feed = client.feed('user', crypto.randomUUID());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Import the crypto module.

The crypto object is used here but not imported. In testing environments running older Node.js versions, relying on the global crypto object will result in a ReferenceError.

🐛 Proposed fix

Add the following import at the top of the file:

import crypto from 'node:crypto';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/feeds-client/__integration-tests__/docs-snippets/translation.test.ts`
at line 20, Import the Node.js crypto module in the translation test before its
use in the feed initialization expression, so the existing crypto.randomUUID
call resolves explicitly across supported Node.js versions.

Comment thread packages/feeds-client/__integration-tests__/docs-snippets/translation.test.ts Outdated
szuperaz and others added 2 commits July 14, 2026 11:43
Temporarily skip until feeds.stories_feed.updated delivery is reliable.

Co-authored-by: Cursor <cursoragent@cursor.com>
@itsmeadi

Copy link
Copy Markdown
Contributor Author

Skipped the flaky Stories Feed integration suite with `describe.skip` for now — it intermittently times out waiting for `feeds.stories_feed.updated`.

itsmeadi and others added 2 commits July 16, 2026 00:25
Keep the rest of the Stories Feed suite running; only the direct-feed
mark-watched assertion flakes on feeds.stories_feed.updated.

Co-authored-by: Cursor <cursoragent@cursor.com>
Translate to Spanish before asserting es_text projection, and use
updateUsers instead of the non-existent upsertUsers on FeedsClient.

Co-authored-by: Cursor <cursoragent@cursor.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/feeds-client/__integration-tests__/stories.test.ts (1)

97-98: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid landing an unconditional skip without a recovery plan.

it.skip removes coverage for the direct-read stories-feed contract. Please link an issue/owner and fix the event-wait synchronization or delivery problem, then re-enable this test; otherwise this regression can remain undetected indefinitely.

As per coding guidelines, maintain high test coverage when changing TypeScript code.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/feeds-client/__integration-tests__/stories.test.ts` around lines 97
- 98, Remove the unconditional skip from the `user reads user1's story feed
directly` test, diagnose and fix the event-wait synchronization or delivery
issue causing intermittent timeouts, and re-enable the test so the direct-read
stories-feed contract remains covered; if the fix cannot be completed
immediately, add an issue or owner reference documenting the recovery plan.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/feeds-client/__integration-tests__/docs-snippets/translation.test.ts`:
- Around line 64-72: Capture the result of updateUsers in the translation test
and assert that response.users[user.id].language equals 'en'. Keep the existing
user update payload unchanged and add the assertion immediately after the call.

---

Nitpick comments:
In `@packages/feeds-client/__integration-tests__/stories.test.ts`:
- Around line 97-98: Remove the unconditional skip from the `user reads user1's
story feed directly` test, diagnose and fix the event-wait synchronization or
delivery issue causing intermittent timeouts, and re-enable the test so the
direct-read stories-feed contract remains covered; if the fix cannot be
completed immediately, add an issue or owner reference documenting the recovery
plan.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ef5f1e43-edad-49f4-8d65-b23f8f66f851

📥 Commits

Reviewing files that changed from the base of the PR and between 42814c9 and 576f2bc.

📒 Files selected for processing (2)
  • packages/feeds-client/__integration-tests__/docs-snippets/translation.test.ts
  • packages/feeds-client/__integration-tests__/stories.test.ts

Comment thread packages/feeds-client/__integration-tests__/docs-snippets/translation.test.ts Outdated
Drop unused watch on setup and assert updateUsers sets language.

Co-authored-by: Cursor <cursoragent@cursor.com>
@itsmeadi
itsmeadi merged commit 19c27b2 into main Jul 16, 2026
7 of 12 checks passed
@itsmeadi
itsmeadi deleted the FEEDS-1667 branch July 16, 2026 13:45
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