* Add CLAUDE.md documentation files for webapp directories
- Add root webapp CLAUDE.md with overview and build commands
- Add channels CLAUDE.md with architecture and testing info
- Add documentation for actions, components, selectors, utils
- Add documentation for sass, tests, and mattermost-redux
- Add platform documentation for client and types
- Update .gitignore
* Add CLAUDE docs and allow tracking
* Clarify CLAUDE instructions for i18n workflow
* Refactor webapp/CLAUDE.md into a nested hierarchy
Decomposed the monolithic webapp/CLAUDE.md into focused, context-aware
files distributed across the directory structure:
- webapp/CLAUDE.md (Root overview)
- webapp/channels/CLAUDE.md (Channels workspace)
- webapp/channels/src/components/CLAUDE.md
- webapp/channels/src/actions/CLAUDE.md
- webapp/channels/src/selectors/CLAUDE.md
- webapp/channels/src/packages/mattermost-redux/CLAUDE.md
- webapp/platform/CLAUDE.md (Platform workspace)
- webapp/platform/client/CLAUDE.md
* Move files to optional, then add script to move them to proper claud.md
* initial implementation of test documentation in spec file with AI-assisted prompt from Claude and linter script
* update snapshots
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
With some neat generics, I was able to refactor
the scanning to a util function. I used it to
refactor 3 places and also removed an unnecessary method.
Claude was quite good here.
https://mattermost.atlassian.net/browse/MM-62755
```release-note
NONE
```
Every time we load the RHS, we used to load the FULL thread always. Although
the actual ThreadViewer React component is virtualized, and the server side
API call is paginated, we still went through all the pages, to get the full
thread and passed it on to the ThreadViewer. This would be for first loads,
and subsequent loads of the same thread.
This was a bug originally, but then it was a necessity after we applied websocket event scope because
now we won't get emoji reactions of a thread if the user is not on the thread.
To fix that, we enhance the thread loading functionality by adding support for fetching
thread updates based on the UpdateAt timestamp. Now, for subsequent loads,
we only get the changed posts in a thread. The implementation:
- Adds new API parameters: fromUpdateAt and updatesOnly to the GetPostThread endpoint
- Updates database queries to support sorting and filtering by UpdateAt
- Implements thread state management to track the last update timestamp
- Adds client-side support to use incremental loading for improved performance
- Ensures proper validation for parameter combinations and error handling
This change enables more efficient thread loading, particularly for long threads
with frequent updates, by only fetching posts that have been updated since the
last view.
Caveats: For delta updates, the SQL query won't use the best index possible
because we have an index for (CreateAt, Id), but no index for (UpdateAt, Id).
However, from my tests, it is not as bad as it looks:
```
[loadtest] # EXPLAIN (ANALYZE, BUFFERS) SELECT * FROM Posts WHERE Posts.DeleteAt = 0 AND Posts.RootId = 'qbr5gctu9iyg8c36hpcq6f3w8e' AND Posts.UpdateAt > 1623445795824 ORDER BY UpdateAt ASC, Id ASC LIMIT 61;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=8.31..8.31 rows=1 width=216) (actual time=0.047..0.049 rows=0 loops=1)
Buffers: shared hit=2
-> Sort (cost=8.31..8.31 rows=1 width=216) (actual time=0.044..0.045 rows=0 loops=1)
Sort Key: updateat, id
Sort Method: quicksort Memory: 25kB
Buffers: shared hit=2
-> Index Scan using idx_posts_root_id_delete_at on posts (cost=0.28..8.30 rows=1 width=216) (actual time=0.031..0.032 rows=0 loops=1)
Index Cond: (((rootid)::text = 'qbr5gctu9iyg8c36hpcq6f3w8e'::text) AND (deleteat = 0))
Filter: (updateat > '1623445795824'::bigint)
Buffers: shared hit=2
Planning:
Buffers: shared hit=3
Planning Time: 0.508 ms
Execution Time: 0.106 ms
(14 rows)
```
We still get an index scan with index cond. Although there's a filter element, but atleast we get the whole thread with the index.
My thinking is that while the whole thread might be large, but after that, updates on a thread should be incremental.
Therefore, we should be okay without adding yet another index on the posts table.
This is just the first step in what could be potentially improved further.
1. We shouldn't even be loading the full thread always. But rather let the virtualized viewer
load more posts on demand.
2. If a post has been just reacted to, then we need not send the whole post down, but just the
reaction. This further saves bandwidth.
https://mattermost.atlassian.net/browse/MM-56548
TBD: Add load-test coverage to update the thread loading code
```release-note
NONE
```
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* move "e2e-tests/playwright/test" to "e2e-tests/playwright/test" and expose "ensurePluginsLoaded"
* add test setup, and expose ensurePluginsLoaded and ensureServerDeployment to pw
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>
* MM-43753: Module workspaces
Move to module workspaces
We make the following changes:
- Remove the vendor directory.
- Dynamically create the go.work file if it doesn't exist.
- Set the MM_SERVER_PATH for enterprise tests.
https://mattermost.atlassian.net/browse/MM-43753
```release-note
NONE
```
* Fix missing reference to MM_SERVER_PATH
```release-note
NONE
```
* Update test to add another nested dir
```release-note
NONE
```
* Have separate script to create go.work file
```release-note
NONE
```
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Update schemas to include new indexes
* Increase local usability of gitlab scripts. (#18314)
* Increase local usability of gitlab scripts.
* Fix loading/saving SQL dumps
* Add logging to schema tests.
* Fix adding logs dir.
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Co-authored-by: Elisabeth Kulzer <elikul@elikul.de>
Remote Cluster Service
- provides ability for multiple Mattermost cluster instances to create a trusted connection with each other and exchange messages
- trusted connections are managed via slash commands (for now)
- facilitates features requiring inter-cluster communication, such as Shared Channels
Shared Channels Service
- provides ability to shared channels between one or more Mattermost cluster instances (using trusted connection)
- sharing/unsharing of channels is managed via slash commands (for now)
Mobile users were having their sessions unexpectedly expired, despite having ServiceSettings.ExtendSessionLengthWithActivity enabled.
Every time a mobile app is opened it called `/api/v4/sessions/device` which calls attachDeviceId which calls `(*Session)SetExpireInDays`. This code above assumed the expiry should be relative to CreateAt which is incorrect when ExtendSessionLengthWithActivity is enabled. Therefore, every time the mobile app was opened, the maximum expiry was set in memory to CreateAt + session_length, even if the session was extended.
(*Session)SetExpireInDays is now deprecated and replaced with (*App)SetSessionExpireInDays which takes into account the ExtendSessionLengthWithActivity setting.
* Configurable dev environment
* Add a bit of documentation
* fixing gofmt
* A bit more doc
* Using variable
* Adding license header
* Moving LDAP_DATA variable to the default-config.mk file
* Adding another docker-compose for the makefile to not brake anybody workflow
* Moving dejavu to the config
* Fixing docker-compose.makefile.yaml for dejavu
* Adding keycloak support to the dev environment
* Address PR review comments
* Removing minio from default docker images
* Changing the default version of mysql to the oldest supported (5.6)
* Change the restart option to no for the dev environment
* Fixing restart option
* Reverting unneded changes
* Restoring 5.7 to check if test passes
* Going back to 5.6 mysql image
* Fixing tests on mysql 5.6
* Skipping flaky test
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Remove unnecessary struct2interface dependency
Running go mod tidy on the repo removes it.
This was also preventing 1.14beta from running the repo,
because now it verifies modules.txt with go.mod, which had a mismatch.
* fixing CI
* Fix test-server target
* Fix some discrepancies in vendor
* Removing the Makefile target for now
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
* begin backend plugin wip
* flesh out rpcplugin. everything done except for minor supervisor stubs
* done with basic plugin infrastructure
* simplify tests
* remove unused test lines
* Major post list refactor
* Fix post and thread deletion
* Fix preferences not selecting correctly
* Fix military time displaying
* Fix UP key for editing posts
* Fix ESLint error
* Various fixes and updates per feedback
* Fix for permalink view
* Revert to old scrolling method and various fixes
* Add floating timestamp, new message indicator, scroll arrows
* Update post loading for focus mode and add visibility limit
* Fix pinning posts and a react warning
* Add loading UI updates from Asaad
* Fix refreshing loop
* Temporarily bump post visibility limit
* Update infinite scrolling
* Remove infinite scrolling
* Added initial job server
* Added job server to be ran as part of platform
* Added test job to the enterprise repo
* Fixed job server not loading license
* Renamed job package to jobs
* Fixed TE not being buildable
* Added JobStatus table to database
* Changed fields used by JobStatus
* Added APIs to query job status
* Added config change listener to server
* Added option to run job server from Makefile
* Added ability to enable/disable jobs from config
* Commented out placeholder for search indexing job
* Fixed govet
* Removed debug messages and fixed job api init message
* Updating client dependancies. Switching to using yarn.
* Updating React
* Moving pure components to using function syntax (performance gains with newer react version)
* Updating client dependancies.
* Ignore .yarninstall
* Enabling pre-lockfile because it's the entire point of using yarn.
* Removing old webpack config
* Moving to new prop-types
* Fixing ESLint Errors
* Updating jest snapshots.
* Cleaning up package.json
This migrates the existing webapp tests to using Jest and Enzyme. The
infrastructure is put in place for React component testing, and a few
simple example component tests are implemented.
This also adds snapshot testing of components, coverage checking for the
webapp (although that is not yet integrated to Coveralls), and the
ability to run npm run test:watch to automatically re-run affected tests
when working on the webapp codebase.