Skip to content

release: v1.3.3 — fix Workspace aliases and account isolation - #89

Merged
hoangsvit merged 45 commits into
mainfrom
dev
Jul 29, 2026
Merged

release: v1.3.3 — fix Workspace aliases and account isolation#89
hoangsvit merged 45 commits into
mainfrom
dev

Conversation

@hoangsvit

@hoangsvit hoangsvit commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary

  • release Gmail Alias Toolkit 1.3.3 from dev to main;
  • preserve Google Workspace domains in website-aware alias suggestions;
  • prevent previous aliases, recent history, and favorites from leaking across accounts;
  • validate malformed email and stored-history data before rendering or generating aliases;
  • move extension changelog data into a dedicated typed module;
  • harden scoped-storage precedence and reject non-finite history timestamps.

Bug fixes

  • Workspace accounts now generate aliases with their selected domain instead of forcing @gmail.com.
  • A scoped storage key that exists as null or malformed data no longer falls back to legacy global history.
  • History entries with NaN, Infinity, or -Infinity timestamps are ignored.
  • Previous website aliases are returned only when they belong to the active account.

Tests

  • TypeScript compile
  • Unit and regression tests
  • Production extension build
  • Manifest-scope verification
  • Website build
  • PR Preview build
  • CodeRabbit findings addressed

Notes

  • Package version: 1.3.3
  • Base: main
  • Head: dev
  • No tag, GitHub Release, or store publication is created by merging this PR.

hoangsvit and others added 30 commits July 29, 2026 10:46
@eplus-bot

Copy link
Copy Markdown
Contributor

Thank you for creating this pull request and helping make the project better.

We will review / merge it when we are online.

@eplus-bot eplus-bot added needs-review Pull request is ready for maintainer review app Application or extension source code ui User interface or visual changes tests Test coverage or test tooling changes build-ci Build, CI, release, or project configuration labels Jul 29, 2026
@eplus-bot
eplus-bot self-requested a review July 29, 2026 16:28
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Release 1.3.3: Workspace-safe website aliases + inline history isolation

🐞 Bug fix 🧪 Tests ✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Preserve Google Workspace domains when generating website-aware alias suggestions.
• Isolate website aliases, inline history, and favorites to the active account.
• Extract changelog data into a typed module and validate it with tests.
Diagram

graph TD
  CS["Content script popup"] --> IHS["Inline history svc"] --> ST[("Browser storage")]
  WAS["Website alias svc"] --> ST
  IHS --> U["Popup utils"]
  WAS --> U
  SET["Settings UI"] --> CH["Changelog data"] --> VER["Version module"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Route inline-history reads through background messaging
  • ➕ Avoids direct storage access from the content script (simpler permission/story)
  • ➕ Centralizes storage error handling and telemetry in one place
  • ➖ Adds async message plumbing + more moving parts
  • ➖ Higher latency/complexity for a relatively small data read
2. Schema-validate storage payloads (e.g., Zod)
  • ➕ Clear, declarative validation for legacy/malformed entries
  • ➕ Easier to evolve storage formats safely
  • ➖ Introduces a dependency and bundle-size impact
  • ➖ May be overkill given current narrow parsing needs
3. Single shared “HistoryRepository” for popup + inline flows
  • ➕ Prevents future divergence between popup history and inline history behavior
  • ➕ Makes cross-account isolation rules harder to regress
  • ➖ Requires refactoring existing popup/history code paths beyond the immediate bug fixes

Recommendation: The PR’s approach (extracting a dedicated inline history loader and reusing existing account/alias utilities) is a good balance of safety and scope: it removes duplicated parsing logic, enforces account isolation consistently, and is well-covered by regression tests. Consider background-messaging or schema validation only if storage access patterns expand or formats evolve further.

Files changed (9) +637 / -227

Bug fix (3) +133 / -53
index.tsUse inline history service for account-scoped history/favorites loading +4/-34

Use inline history service for account-scoped history/favorites loading

• Replaces the content script’s ad-hoc browser.storage parsing with a single call to loadInlineAccountHistory(activeEmail). This reduces duplication and ensures inline History/Favorites are filtered and ordered consistently per active account.

entrypoints/content/index.ts

inlineHistoryService.tsNew inline history loader with legacy fallbacks and account isolation +104/-0

New inline history loader with legacy fallbacks and account isolation

• Adds a dedicated service that loads history and favorites from account-scoped keys with legacy global-key fallback. Validates entry shapes, filters aliases by active account, sorts history newest-first, and propagates storage errors to callers.

src/services/inlineHistoryService.ts

websiteAliasService.tsPreserve Workspace domain and validate base email for website suggestions +25/-19

Preserve Workspace domain and validate base email for website suggestions

• Ensures getPreviousAliasForWebsite ignores stored aliases not owned by the active account. Updates generateSuggestionsForWebsite to validate baseEmail and to generate plus-addressed aliases via generateAlias so the original domain (e.g., Workspace) is preserved rather than forcing @gmail.com.

src/services/websiteAliasService.ts

Refactor (1) +5 / -160
Settings.tsxExtract changelog types/data into a dedicated module +5/-160

Extract changelog types/data into a dedicated module

• Removes inline ChangelogEntry/ChangelogChange definitions and the embedded CHANGELOG constant. Imports typed changelog data from entrypoints/popup/data/changelog for reuse and easier maintenance.

entrypoints/popup/components/Settings.tsx

Tests (3) +323 / -13
changelogData.test.tsAdd tests to keep changelog aligned with app version and ordering +42/-0

Add tests to keep changelog aligned with app version and ordering

• Adds vitest coverage ensuring the changelog starts with APP_VERSION, keeps versions unique and sorted newest-first, and enforces a valid date format with non-empty change items.

tests/popup/changelogData.test.ts

inlineHistoryService.test.tsAdd regression coverage for inline history isolation and malformed storage +197/-0

Add regression coverage for inline history isolation and malformed storage

• Adds comprehensive service tests covering account-scoped vs legacy storage precedence, Workspace-only filtering, malformed entry skipping, non-array storage handling, and error propagation when browser.storage fails.

tests/services/inlineHistoryService.test.ts

websiteAliasService.test.tsHarden website alias service tests for Workspace domains and mock strategy +84/-13

Harden website alias service tests for Workspace domains and mock strategy

• Switches to a partial mock that keeps real alias utilities while overriding getAccountStorageKey for deterministic keys. Adds tests for cross-account alias leakage prevention, rejection of malformed base emails, and preservation of Workspace domains in suggestions.

tests/services/websiteAliasService.test.ts

Documentation (1) +175 / -0
changelog.tsAdd typed changelog dataset including v1.3.3 release notes +175/-0

Add typed changelog dataset including v1.3.3 release notes

• Introduces a new typed changelog module exporting CHANGELOG plus supporting types. Adds the 1.3.3 entry describing Workspace-domain preservation, account filtering, and base-email validation fixes.

entrypoints/popup/data/changelog.ts

Other (1) +1 / -1
package.jsonBump package version to 1.3.3 +1/-1

Bump package version to 1.3.3

• Updates the extension/package version from 1.3.2 to 1.3.3 to reflect the new release.

package.json

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Preview removed

The temporary website preview for this pull request has been removed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
src/services/websiteAliasService.ts (1)

70-71: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Document the changed exported service APIs.

  • src/services/websiteAliasService.ts#L70-L71: add JSDoc above getPreviousAliasForWebsite describing its account-ownership filtering.
  • src/services/websiteAliasService.ts#L83-L112: add JSDoc above generateSuggestionsForWebsite describing domain-preserving suggestion generation.

As per coding guidelines, “Every function declaration, arrow function, and exported component must have at least a one-line JSDoc comment describing its purpose.”

🤖 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 `@src/services/websiteAliasService.ts` around lines 70 - 71, Document both
exported service APIs with one-line JSDoc comments: above
getPreviousAliasForWebsite, describe that it filters previous aliases by account
ownership; above generateSuggestionsForWebsite, describe that it generates
suggestions while preserving the website’s domain. Apply the documentation at
both affected ranges in src/services/websiteAliasService.ts: lines 70-71 and
83-112.

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 `@src/services/inlineHistoryService.ts`:
- Around line 24-27: Update the inline history candidate validation around the
email and timestamp checks to require Number.isFinite(candidate.timestamp),
rejecting NaN and positive or negative Infinity while preserving valid numeric
timestamps. Add coverage for malformed entries containing non-finite timestamps.
- Around line 70-76: Update selectStoredValue so precedence is based on whether
accountKey exists in storage, rather than nullish value checks: return the
scoped entry whenever the key is present, including null, and only use legacyKey
when the scoped key is absent. Add a regression test covering a null scoped
value with valid legacy data and verify parsing normalizes the scoped result to
empty.

In `@tests/popup/changelogData.test.ts`:
- Around line 23-42: Add a beforeEach reset hook to the “extension changelog
data” suite before its tests, using the project’s established state-reset
mechanism and ensuring each test starts from clean state.
- Around line 23-42: Document every arrow-function callback in the “extension
changelog data” tests with a one-line JSDoc comment describing its purpose,
including the describe/it callbacks and the versions map and changes flatMap
callbacks. Preserve the existing test behavior and assertions.
- Around line 5-21: Update the tests for compareVersionsDescending to invoke the
comparator directly, covering newer, older, and equal version inputs so its
return-0 equality path is executed. Keep the existing unique-version sort
assertion and add focused cases that exercise all comparator branches.

---

Nitpick comments:
In `@src/services/websiteAliasService.ts`:
- Around line 70-71: Document both exported service APIs with one-line JSDoc
comments: above getPreviousAliasForWebsite, describe that it filters previous
aliases by account ownership; above generateSuggestionsForWebsite, describe that
it generates suggestions while preserving the website’s domain. Apply the
documentation at both affected ranges in src/services/websiteAliasService.ts:
lines 70-71 and 83-112.
🪄 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 Plus

Run ID: 9ad8b791-2cb9-457e-9bb1-3031f4a7a83a

📥 Commits

Reviewing files that changed from the base of the PR and between 418e9bf and a260291.

📒 Files selected for processing (9)
  • entrypoints/content/index.ts
  • entrypoints/popup/components/Settings.tsx
  • entrypoints/popup/data/changelog.ts
  • package.json
  • src/services/inlineHistoryService.ts
  • src/services/websiteAliasService.ts
  • tests/popup/changelogData.test.ts
  • tests/services/inlineHistoryService.test.ts
  • tests/services/websiteAliasService.test.ts

Comment thread src/services/inlineHistoryService.ts
Comment thread src/services/inlineHistoryService.ts Outdated
Comment thread tests/popup/changelogData.test.ts
Comment thread tests/popup/changelogData.test.ts Outdated
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

eplus-bot
eplus-bot previously approved these changes Jul 29, 2026

@eplus-bot eplus-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved by @eplus-bot after all pull request checks passed.

CI run: https://github.com/ePlus-DEV/gmail-alias-toolkit/actions/runs/30470850184

@eplus-bot

Copy link
Copy Markdown
Contributor

CI passed

Approved by @eplus-bot after all pull request checks passed.

Approval refresh: #1
CI updated: 2026-07-29T16:28:54Z
CI attempt: #1
Approval workflow: #449.1

CI run: https://github.com/ePlus-DEV/gmail-alias-toolkit/actions/runs/30470850184

Copy link
Copy Markdown
Member Author

@eplus-bot review

@eplus-bot eplus-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved by @eplus-bot after all checks passed for commit eba34e5cab723c86e964c1a0fcbefd3d97a56edc.

@eplus-bot

Copy link
Copy Markdown
Contributor

✅ eplus-bot reviewed and approved commit eba34e5cab723c86e964c1a0fcbefd3d97a56edc.

@hoangsvit hoangsvit changed the title v.1.3.3 release: v1.3.3 — fix Workspace aliases and account isolation Jul 29, 2026
@hoangsvit
hoangsvit merged commit fe23e2e into main Jul 29, 2026
12 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for helping make Gmail Alias Toolkit better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application or extension source code build-ci Build, CI, release, or project configuration needs-review Pull request is ready for maintainer review tests Test coverage or test tooling changes ui User interface or visual changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants