Skip to content

MWPW-204282: Fix broken status filter in M@S Studio - #1165

Open
Axelcureno wants to merge 50 commits into
mainfrom
MWPW-204282
Open

MWPW-204282: Fix broken status filter in M@S Studio#1165
Axelcureno wants to merge 50 commits into
mainfrom
MWPW-204282

Conversation

@Axelcureno

Copy link
Copy Markdown
Member

Resolves https://jira.corp.adobe.com/browse/MWPW-204282

The Fragments table Status filter queried the mas:status/* AEM tag, while the Status column shows the fragment's real publication state. Those had fully diverged: of 300 sandbox fragments, zero carried mas:status/published while 50 were genuinely PUBLISHED. Selecting Published returned Draft and Modified cards.

A partial bridge existed in mas-repository.js (translating the published tag into filter.status), but the in-memory cache-narrowing path bypassed it, so the filter also worked on a cold search and then silently returned stale results once cached.

  • Status filters on real publication state, server-side via filter.status
  • Options go from 3 to 5: Published, Draft, New, Modified, Unpublished (multi-select)
  • AEM.searchFragment takes an array; the API accepts multiple values and NEW/MODIFIED/UNPUBLISHED are all queryable
  • Store.filters.status is normalized and whitelisted, so an invalid value degrades to no filter
  • Status now participates in the cache key, the narrowing test, and the in-memory filter. Narrowing treats adding a status as widening and forces a refetch, which is the half of the bug unit tests caught red-to-green
  • Legacy mas:status/published special case deleted

Measured against the live API: no rarity penalty. NEW (1 in 300 fragments) is as fast as an unfiltered query.

Not done: manual browser QA. Reviewer check is to open the Status picker, tick Draft, then also tick New and confirm the result set widens.

  • C1. Cover code with Unit Tests
  • C2. Add a Nala test - none exists for the filter panel; needs a call from #fishbags
  • C3. Verify all Checks are green
  • C4. PR description contains working Test Page link
  • C5. Ready to demo from Test Page
  • C6. Re-read Jira and validated ACs

Test URLs:

@aem-code-sync

aem-code-sync Bot commented Aug 18, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

# Conflicts:
#	io/www/test/fragment/pipeline.test.js
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.75%. Comparing base (2f2e131) to head (a370d87).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1165      +/-   ##
==========================================
+ Coverage   90.71%   90.75%   +0.03%     
==========================================
  Files         318      318              
  Lines      101712   101814     +102     
==========================================
+ Hits        92271    92401     +130     
+ Misses       9441     9413      -28     
Files with missing lines Coverage Δ
studio/src/aem/aem.js 52.35% <100.00%> (+0.16%) ⬆️
studio/src/aem/mas-filter-panel.js 91.45% <100.00%> (+1.00%) ⬆️
studio/src/mas-repository.js 81.29% <100.00%> (+0.24%) ⬆️
studio/src/router.js 88.68% <100.00%> (ø)
studio/src/store.js 96.59% <100.00%> (+0.13%) ⬆️

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f2e131...a370d87. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Axelcureno Axelcureno self-assigned this Aug 18, 2026
@Axelcureno

Axelcureno commented Sep 1, 2026

Copy link
Copy Markdown
Member Author

@honstar Added status to the filters hash link, so it round-trips like the other filters now. filtersValidator already sanitizes it, so a hand-edited #status=BOGUS gets dropped.

Also added it to the promotions editor ignorable set, so toggling status there does not trigger the discard prompt.

5 new tests in router.test.js. Full studio suite: 3751 passed, 0 failed.

@Axelcureno

Copy link
Copy Markdown
Member Author

@Andrei4226 I think this landed on the wrong PR. This one only touches the Studio status filter (store.js, router.js, mas-repository.js, mas-filter-panel.js), there are no ost-search.js changes here.

The resolveOsi/resolveOfferId race and the stale this.query point look like they were meant for #1157, which you approved this morning. Mind dismissing the changes-requested here? Happy to take those two in #1157 or a follow-up ticket.

- link Store.filters.status to the hash like locale, tags and personalization
- treat status as ignorable in the promotions editor search-sync check
- drop the now unused TAG_STATUS_PUBLISHED constant
- fix a misleading narrowing test title
@Andrei4226

Copy link
Copy Markdown
Contributor

@Andrei4226 I think this landed on the wrong PR. This one only touches the Studio status filter (store.js, router.js, mas-repository.js, mas-filter-panel.js), there are no ost-search.js changes here.

The resolveOsi/resolveOfferId race and the stale this.query point look like they were meant for #1157, which you approved this morning. Mind dismissing the changes-requested here? Happy to take those two in #1157 or a follow-up ticket.

Sorry @Axelcureno, you're right, this is the wrong PR.
Dismissing the requested changes here.
I will move my review to #1157 as a comment (or a follow-up ticket if you'd rather track it separately, no problem).

@Andrei4226 Andrei4226 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.

LGTM
Nit: I saw that the Status filter has a grey background, unlike the others (it's white in main). Also, I think the chevron should be on the right side, like the other filters in main (just for consistency) and the alignment as well.

Image

Comment thread studio/src/constants.js
};

export const TAG_STATUS_PUBLISHED = 'mas:status/published';
export const TAG_STATUS_PUBLISHED_PATH = '/content/cq:tags/mas/status/published';

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.

Nit: this is unused and can be removed as well.

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