aglinxinyuan opened a new issue, #7805:
URL: https://github.com/apache/texera/issues/7805
### Describe the bug
**1. The user-quota Cache Size column sorts backwards relative to its own
caret.**
`user-quota.component.ts:344-345`'s `sortBySize` returns `b - a`. But
ng-zorro applies `sortOrder === 'ascend' ? compareResult : -compareResult`
(`ng-zorro-antd-table.mjs:822`), and `nzSortDirections` defaults to
`['ascend','descend',null]` (`:1063`) — which `user-quota.component.html:84`'s
`<th [nzSortFn]="sortBySize">` does not override. **So the first click lights
the up-caret while rendering largest-first.**
This is not a house convention: `admin-user.component.ts:268`'s
`sortByAccountCreation` uses the contract-correct `a - b`.
**2. `PresetService.updatePreset` is dead and, if it were called, broken.**
Repo-wide it has no caller outside its own spec. And it cannot work:
`indexOf(presets, originalPreset)` is lodash **reference** equality against a
freshly `JSON.parse`d array, so it always returns `-1`. Reproduced by execution:
```
contains(presets, originalPreset) = true (the guard passes)
indexOf(presets, originalPreset) = -1
splice branch -> deleted the LAST preset, not the target
assign branch -> the replacement was dropped entirely
```
The sibling `updateOrCreatePreset` carries a comment noting presets are
freshly JSON-parsed and uses `findIndex(isEqual)` — the fix was applied there
and not here.
**3. An unreachable template fallback.**
`hugging-face-image-upload.component.html`'s `{{ displayFileName || "Selected
image" }}` can never take the fallback: the enclosing div is gated on
`*ngIf="previewSrc"`, `previewSrc` returns `hasImage ? formControl.value : ""`,
and `displayFileName` then returns either a non-empty filename or `"Uploaded
image"` — never empty.
### How to reproduce?
For (1), open the user-quota result-cache tab and click the Cache Size
header once: the caret points up while the largest rows are listed first.
### Version/Branch
main
### Task Type
- [ ] Refactor / Cleanup
- [ ] DevOps / Deployment / CI
- [ ] Testing / QA
- [ ] Documentation
- [ ] Performance
- [x] Other
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]