After https://github.com/mattermost/mattermost/pull/29209, there were some more
strings which were left out. Sending another PR to fix all of them.
The config validation strings are made generic for simplicity, because they
are called before the search backend is started, and even though you could
check for the config setting, it forces the code order. Therefore, changed
the words to just say "Search" for simplicity.
I tried to use Aider initially for a little while, but ended up fighting
a lot with the search/replace and having to repeat myself over and over again
to get it to do the refactoring. Eventually gave up and did rest of the changes
myself.
```release-note
NONE
```
* reduce usage of Utils.localizeMessage
As we begin to transition to react-intl's `formatjs` for extraction, our custom wrappers like `Utils.localizeMessage` prevent an adoption roadblock.
This is the first in a series of PRs to begin to migrate away in favour of:
* `useIntl` when inside React functional component
* use `injectIntl` and use access the `intl` prop from class components
* use the new `getIntl`, leveraging a memoized `createIntl` and the store outside of React components
I'm pausing in this effort to get a feel from peers on both the substance of these changes and best practices in supporting them.
* prefer shallowWithIntl, renderWithContext, and local injectIntl wrapping
* revert unintentional whitespaces
* clarify getIntl, add minor unit test
* avoid triggering mmjstool
* update e2e tests
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
This test failed because TestWebHubCloseConnOnDBFail failed
and therefore the ChannelMembers table failed to be
renamed back.
We can see that in the logs:
```
teams","request_id":"sdxjxsd1wibd9mb7kc3ixj6g1w","ip_addr":"127.0.0.1","user_id":"afw9qqjh7pnddqakraxnjf1oph","method":"POST","user_id":"afw9qqjh7pnddqakraxnjf1oph","team_id":"bocubwmn4jyrmc1p9uxrc4pwfc","error":"JoinDefaultChannels: Unable to save direct channel., channel_members_save: Error 1146 (42S02): Table 'dbrt3jzcosj3nb8g6mgwmqyss9rh.ChannelMembers' doesn't exist"}
{"timestamp":"2024-11-10 13:52:34.260 Z","level":"error","msg":"Error while invalidating channel member cache","caller":"platform/web_hub.go:524","user_id":"afw9qqjh7pnddqakraxnjf1oph","error":"failed to find ChannelMembers, TeamScheme and ChannelScheme data: Error 1146 (42S02): Table 'dbrt3jzcosj3nb8g6mgwmqyss9rh.ChannelMembers' doesn't exist"}
{"timestamp":"2024-11-10 13:52:34.260 Z","level":"error","msg":"Error while invalidating channel member cache","caller":"platform/web_hub.go:524","user_id":"afw9qqjh7pnddqakraxnjf1oph","error":"failed to find ChannelMembers, TeamScheme and ChannelScheme data: Error 1146 (42S02): Table 'dbrt3jzcosj3nb8g6mgwmqyss9rh.ChannelMembers' doesn't exist"}
```
There is nothing wrong with this test. And while
we are here, we slightly improve the for-select loop
to exit faster.
https://mattermost.atlassian.net/browse/MM-61699
```release-note
NONE
```
Finally I figured out why the log message for
/api/v4/websocket does not appear. It is because
the log gets generated only when the request returns,
and for websockets, the request doesn't return
until the client closes. And because we were closing
the client in a defer clause, the flushing of the logger
would happen before closing the client, therefore
leading to a race condition of the log not appearing
from time to time.
https://mattermost.atlassian.net/browse/MM-61698
```release-note
NONE
```
* feat: Migrate MM-53377 regression test from Cypress to Playwright
* fix: Update mm_53377 regression test to use admin client for setup
* fix: Correct admin client usage in mm_53377 regression test
* refactor: Standardize mm_53377 Playwright test with consistent naming and imports
* fix: Mark MM-T53377 test as fixme for investigation
* Migrating mm_53377_regression_test_spec.js cypress test to playwright
* Fixing linter errors
* Addressing PR review comment
* Fixing broken test
* feat: Migrate actions.js to TypeScript with type annotations
* feat: Migrate actions.js to TypeScript with correct action types
* feat: Add actions plugin for webapp channels
* feat: Migrate actions.js to TypeScript with type annotations
* feat: Add interactive dialog plugin for webapp channels
* feat: Migrate interactive_dialog.js to TypeScript with type definitions
* feat: Add export plugin module for webapp channels
* feat: Migrate export.js to TypeScript with type declarations
* feat: Add initial plugin index file for webapp channels
* feat: migrate plugins/index.js to TypeScript with type definitions
* test: Add export plugin test file
* feat: Migrate export.test.js to TypeScript with type assertions
* feat: Add emoji actions file to webapp channels
* feat: Migrate emoji_actions.js to TypeScript with full type support
* Fixing some issues
* Revert "feat: Migrate emoji_actions.js to TypeScript with full type support"
This reverts commit e64aabe9fc6d36938cbaa40b7acb3356729a6686.
* fixing linter errors
* Fixing CI
* Addressing pr review comments
* Apply suggestions from code review
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
* Fixing linter errors
* Fixing CI
---------
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
https://github.com/mattermost/mattermost/pull/29214 fixed the
race condition in web_hub initialization.
The failure in the test is strange because there's no log
for the websocket request. It's as if th.CreateWebSocketClientWithClient()
never got called at all.
I am re-arranging the lines so that even if it fails,
the table rename happens anyways. But overall, I don't see
any reason for the failure.
https://mattermost.atlassian.net/browse/MM-61698
```release-note
NONE
```
While investigating https://mattermost.atlassian.net/browse/MM-61529,
I noticed that we weren't adding the internal error which made
it impossible to understand what was really happening.
```release-note
NONE
```
I was planning to kick off a campaign for this. But aider can do this just fine.
Starting off with a single file for now. But will slowly send more PRs with larger
commit diffs.
```release-note
NONE
```
Co-authored-by: Mattermost Build <build@mattermost.com>
Drop the legacy `X` suffix from `GetMasterX` and `GetReplicaX`. The
presence of the suffix suggests there's a `non-X` version: but in fact
we migrated these away a long time ago, so remove the cognitive
overhead.
As an aside, this additionally helps avoid trip up LLMs that interpret
this as "something to fix".
We were incorrectly not broadcasting status cache updates
inspite of that being an LRU cache.
We were also not doing it for profilesInChannel cache.
Now we fix it by properly checking the invalidationEvent
which is something local to the cache itself rather
than the cache provider.
https://mattermost.atlassian.net/browse/MM-62077
```release-note
NONE
```
* Add dummy MMReduxAction type and use it in its ActionFunc types
* Use MMReduxAction in mattermost-redux reducers
I updated most reducers except for the following:
- I couldn't figure out how to type the request reducers because of
handleRequest, and it wasn't worth spending time on because it's
stable and we don't really use those.
- The typing reducers are weird because they use WS event names as
constants. They should be given their own action types separate from
the event names, and they probably shouldn't be in mattermost-redux.
There's also a few places that still use AnyAction, but those are for
helpers for individual reducers. In the future, we should probably pass
the data from the action directly into those.
* Add dummy MMAction type and use it in the web app ActionFunc types
* Use MMAction in web app reducers
* Re-export ActionFunc types from mattermost-redux from types/store
* Start using ActionFunc types from types/store instead of mattermost-redux
These are all the places where the type checker failed when I added the
web app version of ActionFunc. I'll move all the other files in a
separate commit.
* Use ActionFunc types from types/store everywhere outside mattermost-redux
* Make types/store versions of ActionFunc use web app GlobalState
* Stop passing GlobalState into ActionFunc explicitly
* Stop casting as GlobalState where it's no longer needed
* Prevent importing mattermost-redux version of ActionFunc in the rest of the app
* Fix no-restricted-imports applying incorrectly to mattermost-redux and types/store
This introduces a new entry in the `Main Menu -> About` modal with the hostname of the currently connected websocket. This will be used to aid debugging issues in clustered environments by showing which node in the cluster is servicing requests for a particular websocket.
This information is only visible in self-managed instances. It will not be visible on cloud instances.
This removes the search input text lowercasing from the
`EmojiPickerSearch` component, where it is used as the text displayed to
the user.
Instead, filter lowercasing is done in the `getFilteredEmojis` function
to make emoji search case-insensitive.
Signed-off-by: Kuruyia <github@kuruyia.net>
* [MM-61477] Fixed exif rotates images width and height is not correctly calculated
* [MM-61477] Apply rotation ony to png or jepg
* [MM-61477] Added test cases to verify correct rotation
* fix: fixed wrong format
* uff
* fix: exif rotation is only possible on jpeg images
---------
Co-authored-by: Mattermost Build <build@mattermost.com>