Skip to content

Conversation

@diegolmello
Copy link
Member

@diegolmello diegolmello commented Nov 6, 2025

Proposed changes

Issue(s)

How to test or reproduce

ABAC

  • open an ABAC managed room
  • long press any message
  • it should not be possible to reply in dm, forward or get link
  • tapping on these actions should display a message about abac managed

Others

  • tapping on other disabled message actions (like Pin) should use the fallback message asking for admin help

Screenshots

Forward is pressed

image

Pin is pressed

image

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • New Features

    • Action items now support custom disabled reasons shown to users instead of generic permission messages.
    • Message actions (reply, forward, and get link) are now restricted based on access policies with clear explanations for disabled states.
  • Localization

    • Updated multi-language translations for access control-related messaging.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Walkthrough

This PR extends the ActionSheet system to support ABAC-based access control for message actions. It adds optional disabledReason and enabled fields to ActionSheet items, implements conditional gating for Reply, Forward, and Get Link actions when ABAC attributes are present, and introduces corresponding internationalization keys across all supported locales.

Changes

Cohort / File(s) Summary
ActionSheet Type Extension
app/containers/ActionSheet/Provider.tsx
Added optional disabledReason?: string field to TActionSheetOptionsItem type to support custom disabled-state messages.
ActionSheet Item Logic
app/containers/ActionSheet/Item.tsx
Modified disabled-state message handling to use item.disabledReason when provided, falling back to default permission translation if unavailable.
Message Actions ABAC Gating
app/containers/MessageActions/index.tsx
Added ABAC-based conditionals (enabled and disabledReason fields) to Reply in DM, Forward, and Get Link actions; actions are disabled when ABAC attributes are present.
Localization Keys (All Locales)
app/i18n/locales/{ar, bn-IN, cs, de, en, es, fi, fr, hi-IN, hu, it, ja, nl, nn, no, pt-BR, pt-PT, ru, sl-SI, sv, ta-IN, te-IN, tr, zh-CN, zh-TW}.json
Added ABAC_disabled_action_reason, ABAC_managed, ABAC_managed_description, and ABAC_room_attributes keys with localized strings; consolidated duplicate key declarations by removing later occurrences to prevent redundancy.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ActionSheet as ActionSheet Item
    participant MessageAction as MessageAction Config

    User->>ActionSheet: Tap disabled action
    ActionSheet->>MessageAction: Check if enabled
    alt ABAC attributes present
        MessageAction->>ActionSheet: enabled = false, disabledReason = custom reason
    else No ABAC attributes
        MessageAction->>ActionSheet: enabled = true
    end
    
    alt Action is disabled
        ActionSheet->>ActionSheet: Emit disabledReason (custom or default)
    else Action is enabled
        ActionSheet->>ActionSheet: Execute hide() + onPress()
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Attention areas:
    • Verify ABAC attribute check logic in MessageActions/index.tsx for correctness across Reply, Forward, and Get Link actions
    • Confirm disabledReason fallback chain in ActionSheet/Item.tsx (custom → default translation)
    • Spot-check a few locale files (e.g., en, ar, pt-BR) to ensure key naming consistency and proper consolidation across all 24+ locale files

Possibly related PRs

  • feat(a11y): toasts to native dialogs #6514: Extends TActionSheetOptionsItem type with additional optional fields (subtitle, accessibilityLabel), following a similar pattern of enhancing ActionSheet item capabilities.

Poem

🐰 The ActionSheet now reasons true,
With ABAC gates to filter through,
When attributes block the way ahead,
A custom message shows instead! ✨
Permissions gated, logic sound,
No more defaults when rules abound.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(ABAC): Disable message actions' clearly and concisely describes the main change—disabling message actions in ABAC-managed rooms. It accurately reflects the core functionality added across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch abac-67

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 and usage tips.

@diegolmello diegolmello requested a deployment to official_android_build November 6, 2025 14:53 — with GitHub Actions Waiting
@diegolmello diegolmello requested a deployment to experimental_android_build November 6, 2025 14:53 — with GitHub Actions Waiting
@diegolmello diegolmello requested a deployment to experimental_ios_build November 6, 2025 14:53 — with GitHub Actions Waiting
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (6)
app/i18n/locales/de.json (1)

17-17: Minor wording polish (optional).

Consider “Nur konforme Benutzer haben Zugriff auf attributbasierte, zugriffsgesteuerte Räume.” (comma improves readability).

app/i18n/locales/zh-TW.json (1)

11-14: ABAC keys added — LGTM; minor copy tweak optional.

Consider clarifying ABAC once in the description for better readability.

- "ABAC_managed_description": "只有符合條件的使用者才能存取基於屬性的存取控制房間。屬性決定房間存取權限。",
+ "ABAC_managed_description": "只有符合條件的使用者才能存取以屬性為基礎的存取控制(ABAC)聊天室。屬性決定聊天室的存取權。",
app/i18n/locales/nl.json (1)

11-14: Minor NL copy improvements (optional).

More natural Dutch:

- "ABAC_managed": "ABAC beheerd",
- "ABAC_managed_description": "Alleen conforme gebruikers hebben toegang tot op attributen gebaseerde toegangsgecontroleerde kamers. Attributen bepalen de toegang tot de kamer.",
+ "ABAC_managed": "Beheerd door ABAC",
+ "ABAC_managed_description": "Alleen geautoriseerde gebruikers hebben toegang tot kamers met toegangscontrole op basis van attributen (ABAC). Attributen bepalen de toegang tot de kamer.",
app/i18n/locales/bn-IN.json (1)

15-18: Bengali copy polish (optional).

Use “শর্তপূরণকারী/যোগ্য” instead of “অনুগত” for “compliant”.

- "ABAC_managed": "ABAC দ্বারা পরিচালিত",
- "ABAC_managed_description": "শুধুমাত্র অনুগত ব্যবহারকারীদের অ্যাট্রিবিউট-ভিত্তিক অ্যাক্সেস নিয়ন্ত্রিত রুমগুলিতে অ্যাক্সেস আছে। অ্যাট্রিবিউটগুলি রুমের অ্যাক্সেস নির্ধারণ করে।",
+ "ABAC_managed": "ABAC-পরিচালিত",
+ "ABAC_managed_description": "শুধুমাত্র শর্তপূরণকারী ব্যবহারকারীদের অ্যাট্রিবিউট-ভিত্তিক অ্যাক্সেস নিয়ন্ত্রিত রুমে প্রবেশাধিকার আছে। অ্যাট্রিবিউট রুমের অ্যাক্সেস নির্ধারণ করে।",
app/containers/ActionSheet/Provider.tsx (1)

17-18: API extension — LGTM; clarify contract.

Add a brief doc that disabledReason must be a user-facing, localized string (not a translation key), since Item.tsx displays it as-is.

 export type TActionSheetOptionsItem = {
   title: string;
   subtitle?: string;
@@
   enabled?: boolean;
-  disabledReason?: string;
+  /**
+   * User-facing reason shown when enabled === false.
+   * Provide a localized message (e.g., I18n.t('ABAC_disabled_action_reason')).
+   */
+  disabledReason?: string;
 };
app/i18n/locales/es.json (1)

11-14: Spanish copy improvement (optional).

“compatibles” is awkward here; propose “autorizados” and include ABAC acronym.

- "ABAC_managed_description": "Solo los usuarios compatibles tienen acceso a las salas controladas por acceso basado en atributos. Los atributos determinan el acceso a la sala.",
+ "ABAC_managed_description": "Solo los usuarios autorizados pueden acceder a salas con control de acceso basado en atributos (ABAC). Los atributos determinan el acceso a la sala.",
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a4f8a94 and 3bb6026.

📒 Files selected for processing (28)
  • app/containers/ActionSheet/Item.tsx (1 hunks)
  • app/containers/ActionSheet/Provider.tsx (1 hunks)
  • app/containers/MessageActions/index.tsx (2 hunks)
  • app/i18n/locales/ar.json (2 hunks)
  • app/i18n/locales/bn-IN.json (2 hunks)
  • app/i18n/locales/cs.json (2 hunks)
  • app/i18n/locales/de.json (2 hunks)
  • app/i18n/locales/en.json (2 hunks)
  • app/i18n/locales/es.json (2 hunks)
  • app/i18n/locales/fi.json (2 hunks)
  • app/i18n/locales/fr.json (2 hunks)
  • app/i18n/locales/hi-IN.json (2 hunks)
  • app/i18n/locales/hu.json (2 hunks)
  • app/i18n/locales/it.json (2 hunks)
  • app/i18n/locales/ja.json (2 hunks)
  • app/i18n/locales/nl.json (2 hunks)
  • app/i18n/locales/nn.json (2 hunks)
  • app/i18n/locales/no.json (2 hunks)
  • app/i18n/locales/pt-BR.json (2 hunks)
  • app/i18n/locales/pt-PT.json (2 hunks)
  • app/i18n/locales/ru.json (2 hunks)
  • app/i18n/locales/sl-SI.json (2 hunks)
  • app/i18n/locales/sv.json (2 hunks)
  • app/i18n/locales/ta-IN.json (2 hunks)
  • app/i18n/locales/te-IN.json (2 hunks)
  • app/i18n/locales/tr.json (2 hunks)
  • app/i18n/locales/zh-CN.json (2 hunks)
  • app/i18n/locales/zh-TW.json (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
app/containers/MessageActions/index.tsx (3)
app/reducers/permissions.ts (1)
  • permissions (13-25)
app/lib/methods/helpers/compareServerVersion.ts (1)
  • compareServerVersion (10-15)
app/ee/omnichannel/sagas/inquiry.js (1)
  • serverVersion (17-17)
app/containers/ActionSheet/Item.tsx (1)
app/containers/Toast.tsx (1)
  • LISTENER (24-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: ESLint and Test / run-eslint-and-test
🔇 Additional comments (39)
app/i18n/locales/fi.json (3)

15-18: Inconsistency: AI summary claims ABAC keys were removed, but they're present in the code.

The AI-generated summary states these keys were removed, yet lines 15–18 show ABAC-related translation keys with ~ markers indicating they're part of this change. Given the PR objective is to implement ABAC-based access control, these keys are likely additions rather than removals. Please clarify whether the summary's description of "removed duplicates from later sections" applies here, or if the summary needs correction.


15-18: ABAC translation keys are properly positioned and formatted.

The four ABAC-related keys are correctly placed in alphabetical order, follow valid JSON syntax, and the Finnish translations are linguistically appropriate and consistent with the PR's ABAC feature scope.


861-861: "Your_workspace" key is correctly positioned as the final entry.

The translation "Työtilasi" (Your workspace) is accurate Finnish and properly formatted. It maintains the file's alphabetical ordering as the last key before the closing brace.

app/i18n/locales/sl-SI.json (1)

15-18: ABAC keys added consistently.

Strings look good and consistent with other locales; no placeholders required. LGTM.

app/i18n/locales/tr.json (2)

11-14: ABAC keys look correct.

Terminology is concise and matches usage; good to go.


668-669: Confirm consistency of Your_workspace across locales.

Ensure this key is present (or intentionally omitted) in all locales to avoid fallback disparities. You can rely on the repo-wide script shared in sl-SI comment.

app/i18n/locales/ta-IN.json (2)

15-18: ABAC translations added.

No placeholders; string lengths are reasonable for toasts/tooltips. LGTM.


899-900: Verify presence across locales.

Keep Your_workspace aligned across all locale files; use the shared verification script to catch gaps.

app/i18n/locales/it.json (2)

15-18: ABAC entries approved.

Clear phrasing; consistent casing. No issues spotted.


685-686: Your_workspace key present.

Confirm all locales carry this key (or a defined fallback policy). Covered by the verification script referenced earlier.

app/i18n/locales/sv.json (2)

15-18: ABAC strings added.

Swedish phrasing is concise; matches intended UI labels. Good.


859-860: Ensure cross-locale parity for Your_workspace.

Alignment across locales avoids mixed fallback. See repo-wide check script (sl-SI comment).

app/i18n/locales/zh-CN.json (2)

11-14: ABAC keys localized well.

Terminology reads naturally (“ABAC 管理/房间属性”); okay for headers/tooltips.


628-629: Confirm uniform presence of Your_workspace.

Please validate coverage with the shared script; avoid relying on default fallback here.

app/i18n/locales/pt-BR.json (2)

15-18: ABAC translations added and consistent.

Tone matches existing locale style. LGTM.


986-987: Your_workspace: consistency check.

Please ensure this key exists across all locales (or document fallback). Covered by the verification script noted earlier.

app/i18n/locales/ar.json (1)

11-14: LGTM – ABAC keys and “Your_workspace”.

Strings read well; no placeholders to validate.

Also applies to: 636-636

app/i18n/locales/hi-IN.json (1)

15-18: LGTM – ABAC keys and “Your_workspace”.

Consistent and clear.

Also applies to: 899-899

app/i18n/locales/nn.json (2)

10-13: Nynorsk pluralization check for “Romattributt”.

Please confirm whether “Romattributt” should be pluralized (same form vs “Romattributt(ar)”) in this context; adjust if needed.


403-403: LGTM – invite-link string keeps placeholders intact.

app/i18n/locales/ru.json (1)

15-18: LGTM – ABAC keys and “Ваш сервер”.

Terminology and cases look correct.

Also applies to: 829-829

app/i18n/locales/de.json (1)

15-18: LGTM – keys added and workspace string.

Also applies to: 889-889

app/i18n/locales/te-IN.json (1)

15-18: LGTM – ABAC keys and “మీ వర్క్‌స్పేస్”.

No placeholders; acronym retained consistently.

Also applies to: 898-899

app/i18n/locales/cs.json (1)

15-18: LGTM – ABAC keys and Czech translations verified.

Verification complete:

  • ✓ cs.json lines 15–18: All 4 ABAC_* keys present, no duplicates
  • ✓ cs.json line 975: "Your_workspace": "Váš pracovní prostor" correct
  • ✓ All 25 populated locales include ABAC_disabled_action_reason consistently
  • ✓ No duplicate ABAC_* keys across codebase

Code changes are correct and properly localized.

app/i18n/locales/zh-TW.json (1)

657-657: Key present — LGTM.

"Your_workspace" translation looks correct and consistent.

app/i18n/locales/no.json (1)

949-949: Key present — LGTM.

"Your_workspace" is consistent.

app/i18n/locales/nl.json (1)

782-782: Key present — LGTM.

app/i18n/locales/bn-IN.json (1)

899-899: Key present — LGTM.

app/i18n/locales/fr.json (2)

11-14: ABAC keys — LGTM.


783-783: Key present — LGTM.

app/i18n/locales/es.json (1)

455-455: Key is actively used—keep as-is.

The "Your_Password_Must_Have" key is referenced in app/containers/PasswordPolicies/index.tsx (lines 37 and 40). Removing it would break functionality, so the current translation string should be retained.

app/containers/ActionSheet/Item.tsx (1)

29-30: All ABAC-gated actions properly configured — verified.

All three occurrences correctly pair enabled with disabledReason and use localized strings via I18n.t() with translation keys. Logic is consistent and safe.

app/i18n/locales/en.json (1)

15-18: LGTM! Clear and helpful ABAC translation keys.

The added ABAC-related translation strings are clear and user-friendly. The ABAC_disabled_action_reason provides a concise explanation for disabled actions, while the other keys offer good contextual information about the ABAC feature.

app/i18n/locales/pt-PT.json (1)

11-14: LGTM! Portuguese ABAC translations added.

The Portuguese translations for ABAC keys have been properly added and follow the same pattern as other locales.

app/containers/MessageActions/index.tsx (3)

445-446: LGTM! ABAC gating properly implemented for Reply in DM.

The Reply in DM action correctly combines both permission checks and ABAC attribute checks. When ABAC attributes are present, the action is disabled with an appropriate reason message.


459-466: LGTM! ABAC gating properly implemented for Forward action.

The Forward action is correctly disabled in ABAC-managed rooms with an appropriate explanation. The implementation follows the same pattern as other ABAC-gated actions.


470-476: LGTM! ABAC gating properly implemented for Get link action.

The Get link action is correctly disabled in ABAC-managed rooms. The consistent implementation pattern across all three ABAC-gated actions (Reply in DM, Forward, Get link) makes the code maintainable.

Verified that room.abacAttributes is properly typed in the ISubscription interface as an optional field with shape { name: string; values: string[] }[], and TSubscriptionModel correctly inherits this type definition through its extension of ISubscription.

app/i18n/locales/hu.json (1)

15-18: LGTM! Hungarian ABAC translations added.

The Hungarian translations for ABAC keys have been properly added and follow the same pattern as other locales.

app/i18n/locales/ja.json (1)

11-14: LGTM! Japanese ABAC translations added.

The Japanese translations for ABAC keys have been properly added and follow the same pattern as other locales.

Comment on lines +15 to +18
"ABAC_disabled_action_reason": "Ikke tilgjengelig i ABAC-administrerte rom",
"ABAC_managed": "ABAC-administrert",
"ABAC_managed_description": "Kun kompatible brukere har tilgang til attributtbaserte tilgangskontrollerte rom. Attributter bestemmer romtilgang.",
"ABAC_room_attributes": "Romattributter",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

ABAC keys — LGTM.

Copy reads well in Norwegian Bokmål.

Run to ensure all locales contain the four ABAC keys exactly once:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
missing=0
mapfile -t files < <(fd -t f '.json' app/i18n/locales)
for f in "${files[@]}"; do
  for k in ABAC_disabled_action_reason ABAC_managed ABAC_managed_description ABAC_room_attributes; do
    # key exists
    if ! jq -e --arg k "$k" '.[$k]' "$f" >/dev/null; then
      echo "MISSING $k in $f"
      missing=1
    fi
    # appears exactly once (guards accidental dupes)
    cnt=$(rg -nP "\"$k\"\\s*:" "$f" | wc -l | tr -d ' ')
    if [[ "$cnt" != "1" ]]; then
      echo "DUPLICATE $k ($cnt) in $f"
      missing=1
    fi
  done
done
exit $missing

Length of output: 56


I need to rewrite the verification script to work in the sandbox environment (avoiding process substitution). Let me try a simpler approach:


---

🏁 Script executed:

```shell
#!/bin/bash
set -euo pipefail
missing=0

# Find all JSON files and verify ABAC keys
for f in $(fd -t f '\.json$' app/i18n/locales); do
  for k in ABAC_disabled_action_reason ABAC_managed ABAC_managed_description ABAC_room_attributes; do
    # Check if key exists
    if ! jq -e --arg k "$k" '.[$k]' "$f" >/dev/null 2>&1; then
      echo "MISSING $k in $f"
      missing=1
    fi
    # Check if appears exactly once
    cnt=$(rg -c "\"$k\"\\s*:" "$f" 2>/dev/null || echo 0)
    if [[ "$cnt" != "1" ]]; then
      echo "DUPLICATE $k ($cnt times) in $f"
      missing=1
    fi
  done
done

if [[ $missing -eq 0 ]]; then
  echo "✓ All ABAC keys present and unique across all locales"
fi
exit $missing

Length of output: 21667


ABAC keys missing from all locales except Norwegian — critical localization gap.

Verification found that the four ABAC keys are present only in app/i18n/locales/no.json but absent from 46+ other locale files (af, az, bas-CM, be-BY, bg, bn-BD, bs, ca, cy, da, de-AT, el, eo, et, eu, fa, gl, he, hr, id, ka-GE, kg, km, ko, ku, ln, lo, lt, lv, mn, ms-MY, pl, ro, si, sk-SK, sq, sr, th-TH, ug, uk, vi-VN, zh-HK, and others). These keys must be added to all other locale files with appropriate translations to prevent undefined strings in the UI for non-Norwegian users.

🤖 Prompt for AI Agents
app/i18n/locales/no.json lines 15-18: four ABAC keys
(ABAC_disabled_action_reason, ABAC_managed, ABAC_managed_description,
ABAC_room_attributes) exist only in Norwegian — add these same keys to every
other locale JSON under app/i18n/locales (e.g., af, az, bas-CM, be-BY, bg, ...
zh-HK) to avoid missing strings; for each locale add the keys with proper
translations or a temporary English fallback if translations are not available,
ensure JSON syntax and trailing commas match project style, run the i18n
lint/validation and a quick UI spot-check to confirm no undefined string
appears.

"ABAC_room_attributes": "Atributi sobe",
"ABAC_managed": "ABAC upravljano",
"ABAC_managed_description": "Samo skladni uporabniki imajo dostop do sob z nadzorom dostopa na podlagi atributov. Atributi določajo dostop do sobe."
"Your_workspace": "Vaš delovni prostor"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify global coverage and duplicates for ABAC/Your_workspace.

Before merge, confirm:

  • Every locale defines ABAC_disabled_action_reason, ABAC_managed, ABAC_managed_description, ABAC_room_attributes.
  • No duplicate ABAC keys remain later in any file.
  • Your_workspace exists in all locales or is intentionally omitted (falls back to default).

Run:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) List locales
fd -t f '.json$' app/i18n/locales | sort > /tmp/locales.txt
echo "Locales:"; cat /tmp/locales.txt

# 2) Check required ABAC keys per locale
req_keys=('ABAC_disabled_action_reason' 'ABAC_managed' 'ABAC_managed_description' 'ABAC_room_attributes')
echo -e "\nChecking ABAC keys presence…"
while read -r f; do
  missing=()
  for k in "${req_keys[@]}"; do
    jq -e --arg k "$k" 'has($k)' "$f" >/dev/null || missing+=("$k")
  done
  if ((${#missing[@]})); then
    echo "MISSING in $f: ${missing[*]}"
  fi
done < /tmp/locales.txt

# 3) Spot duplicate keys (jq will keep last; we grep raw to warn)
echo -e "\nScanning possible duplicate ABAC keys…"
while read -r f; do
  hits=$(rg -n '^\s*"ABAC_(disabled_action_reason|managed|managed_description|room_attributes)"\s*:' "$f" | wc -l | tr -d ' ')
  if (( hits > 4 )); then
    echo "Potential duplicates in $f (found $hits ABAC entries)."
  fi
done < /tmp/locales.txt

# 4) Check Your_workspace presence across locales
echo -e "\nYour_workspace coverage:"
while read -r f; do
  if jq -e 'has("Your_workspace")' "$f" >/dev/null; then
    :
  else
    echo "Your_workspace missing: $f"
  fi
done < /tmp/locales.txt

Length of output: 7050


I need to clarify the Your_workspace coverage since that check's output was absent from the results. Let me rerun with explicit reporting:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Explicit Your_workspace coverage check
echo "Checking Your_workspace coverage across all locales…"
missing_ws=()
has_ws=()
while read -r f; do
  if jq -e 'has("Your_workspace")' "$f" >/dev/null 2>&1; then
    has_ws+=("$f")
  else
    missing_ws+=("$f")
  fi
done < <(fd -t f '.json$' app/i18n/locales | sort)

echo "Your_workspace PRESENT in ${#has_ws[@]} locales"
echo "Your_workspace MISSING in ${#missing_ws[@]} locales"
if ((${#missing_ws[@]} > 0)); then
  echo "Missing from:"
  for f in "${missing_ws[@]}"; do echo "  $f"; done
fi

# Also check which locales HAVE all 4 ABAC keys
echo -e "\nLocales WITH all 4 ABAC keys:"
req_keys=('ABAC_disabled_action_reason' 'ABAC_managed' 'ABAC_managed_description' 'ABAC_room_attributes')
complete=()
while read -r f; do
  has_all=true
  for k in "${req_keys[@]}"; do
    jq -e --arg k "$k" 'has($k)' "$f" >/dev/null 2>&1 || { has_all=false; break; }
  done
  if $has_all; then
    complete+=("$f")
  fi
done < <(fd -t f '.json$' app/i18n/locales | sort)

if ((${#complete[@]} > 0)); then
  for f in "${complete[@]}"; do echo "  $f"; done
else
  echo "  (none)"
fi
echo "Total: ${#complete[@]} locales have all ABAC keys"

Length of output: 110


Let me use a simpler approach without process substitution:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Checking Your_workspace coverage across all locales…"
missing_ws_count=0
has_ws_count=0
missing_ws=""

fd -t f '.json$' app/i18n/locales | sort | while read -r f; do
  if jq -e 'has("Your_workspace")' "$f" >/dev/null 2>&1; then
    ((has_ws_count++))
  else
    ((missing_ws_count++))
    missing_ws="$missing_ws
  $f"
  fi
done

# Check which locales HAVE all 4 ABAC keys
echo -e "\nLocales WITH all 4 ABAC keys:"
req_keys=('ABAC_disabled_action_reason' 'ABAC_managed' 'ABAC_managed_description' 'ABAC_room_attributes')
complete_count=0

fd -t f '.json$' app/i18n/locales | sort | while read -r f; do
  has_all=true
  for k in "${req_keys[@]}"; do
    jq -e --arg k "$k" 'has($k)' "$f" >/dev/null 2>&1 || { has_all=false; break; }
  done
  if $has_all; then
    echo "  $f"
    ((complete_count++))
  fi
done | tee /tmp/complete_abac.txt

wc -l < /tmp/complete_abac.txt | xargs echo "Total locales with all ABAC keys:"

Length of output: 52


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Checking Your_workspace coverage across all locales…"
total_locales=$(fd -t f '.json$' app/i18n/locales | wc -l)
has_ws=$(fd -t f '.json$' app/i18n/locales | while read f; do jq -e 'has("Your_workspace")' "$f" >/dev/null 2>&1 && echo "$f"; done | wc -l)
missing_ws=$((total_locales - has_ws))

echo "Your_workspace PRESENT in $has_ws/$total_locales locales"
if ((missing_ws > 0)); then
  echo "Your_workspace MISSING in $missing_ws locales:"
  fd -t f '.json$' app/i18n/locales | while read f; do
    jq -e 'has("Your_workspace")' "$f" >/dev/null 2>&1 || echo "  $f"
  done
fi

# Check which locales HAVE all 4 ABAC keys
echo -e "\nLocales WITH all 4 ABAC keys:"
req_keys=('ABAC_disabled_action_reason' 'ABAC_managed' 'ABAC_managed_description' 'ABAC_room_attributes')

fd -t f '.json$' app/i18n/locales | sort | while read f; do
  has_all=true
  for k in "${req_keys[@]}"; do
    jq -e --arg k "$k" 'has($k)' "$f" >/dev/null 2>&1 || { has_all=false; break; }
  done
  if $has_all; then
    echo "$f"
  fi
done | tee /tmp/abac_complete.txt

echo "Total: $(wc -l < /tmp/abac_complete.txt) locales have all 4 ABAC keys"

Length of output: 1507


Let me get the exact count of locales with all ABAC keys:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Locales WITH all 4 ABAC keys:"
req_keys=('ABAC_disabled_action_reason' 'ABAC_managed' 'ABAC_managed_description' 'ABAC_room_attributes')
count=0

fd -t f '.json$' app/i18n/locales | sort | while read f; do
  has_all=true
  for k in "${req_keys[@]}"; do
    jq -e --arg k "$k" 'has($k)' "$f" >/dev/null 2>&1 || { has_all=false; break; }
  done
  if $has_all; then
    echo "$f"
    ((count++))
  fi
done > /tmp/abac_complete.txt

cat /tmp/abac_complete.txt
echo ""
echo "Total: $(cat /tmp/abac_complete.txt | wc -l) locales have all 4 ABAC keys"

Length of output: 29


Critical pre-merge gaps detected: ABAC keys absent globally, Your_workspace inconsistently deployed.

Verification findings:

  • ABAC keys: None of the 67 locales (0%) currently define all 4 required keys (ABAC_disabled_action_reason, ABAC_managed, ABAC_managed_description, ABAC_room_attributes). Feature appears incomplete across the codebase.
  • Your_workspace: Present in only 20/67 locales (30%); missing from 47, including en.json. sl-SI.json has it.
  • Duplicates: None detected.

Before merge, either:

  1. Add all 4 ABAC keys to all locales (not just sl-SI.json), or
  2. Explicitly document ABAC feature scope and fallback strategy.
  3. Add Your_workspace to all missing locales or clarify fallback intent.

Current state does not meet the stated verification requirements.

Copy link
Contributor

@OtavioStasiak OtavioStasiak left a comment

Choose a reason for hiding this comment

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

Looks good to me!

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.

3 participants