Commit graph

12 commits

Author SHA1 Message Date
Ben Schumacher
d78d59babe
Standardize request.CTX parameter naming to rctx (#33499)
* Standardize request.CTX parameter naming to rctx

- Migrate 886 request.CTX parameters across 147 files to use consistent 'rctx' naming
- Updated function signatures from 'c', 'ctx', and 'cancelContext' to 'rctx'
- Updated function bodies to reference the new parameter names
- Preserved underscore parameters unchanged as they are unused
- Fixed method receiver context issue in store.go

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Use request.CTX interface in batch worker

* Manual fixes

* Fix parameter naming

* Add linter check

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-10 15:11:32 +02:00
Jesse Hallam
e6d8bf5835
Upgrade Go to 1.24.3 (#31220)
* Upgrade Go to 1.24.3

Updates the following files:
- server/.go-version: 1.23.9 → 1.24.3
- server/build/Dockerfile.buildenv: golang:1.23.9-bullseye → golang:1.24.3-bullseye
- server/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3
- server/public/go.mod: go 1.23.0 → go 1.24.3, toolchain go1.23.9 → go1.24.3

Also fixes non-constant format string errors introduced by Go 1.24.3's stricter format string checking:
- Added response() helper function in slashcommands/util.go for simple string responses
- Removed unused responsef() function from slashcommands/util.go
- Replaced responsef() with response() for translated strings that don't need formatting
- Fixed fmt.Errorf and fmt.Fprintf calls to use proper format verbs instead of string concatenation
- Updated marketplace buildURL to handle format strings conditionally

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update generated mocks for Go 1.24.3

Regenerated mocks using mockery v2.53.4 to ensure compatibility with Go 1.24.3.
This addresses mock generation failures that occurred with the Go upgrade.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update to bookworm and fix non-existent sha

Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>

* fix non-constant format string

---------

Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Stavros Foteinopoulos <stafot@gmail.com>
2025-06-10 15:04:57 -03:00
David Krauser
4b64eb0e39
Handle error returned by GetClusterInfos() (#30919)
A recent change to the enterprise cluster code introduced a change to the enterprise API interface. GetClusterInfos() can now return an error. This commit introduces code to handle that error.
2025-05-12 13:37:58 -04:00
Agniva De Sarker
cb75a20c54
MM-61904: Make reliable websockets work in HA (#29489)
We do a cluster request to get the active and dead queues
from other nodes in the cluster to sync any missing
information.

We check the dead queue in the other nodes to see
if there's been any message loss or not. Accordingly,
we send just the active queue or both active and dead queues.

There's still an edge case that is left out where
a client could have potentially connected and reconnected
to multiple nodes leaving multiple active queues
in multiple nodes. We don't handle this scenario
because then potentially we need to create
a slice of sendQueueSize * number_of_nodes. And then
this can happen again, leading to an infinite increase
in sendQueueSize.

We leave this edge-case to Redis, acknowledging
a limitation in our architecture.

In this PR, when there's no message loss, we just
take the active queue from the last node it connected
to.

And if there's message loss where the client's
seqNum is within the last node's dead queue, we also
handle that.

But if there's severe message loss where the client's
seqNum falls within the dead queue of another node, then
we just send the data from that node to reconstruct the
data as much as possible. It could be possible to set
a new connection ID in this case, but this involves
more data transfer always from all nodes and recomputing
the state in the requestor node.

https://mattermost.atlassian.net/browse/MM-61904

```release-note
NONE
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-01-17 11:11:32 +05:30
Ben Schumacher
2b426573cd
[MM-60619] Annotate cluster logs messages (#28268) 2024-09-27 09:17:16 +02:00
Ben Schumacher
1158e6358c
[MM-54593] HA aware Support Packet (#27598) 2024-08-03 16:11:13 +02:00
Agniva De Sarker
0cee332001
MM-57152: Get webconn count from the whole cluster (#26813)
We were setting the user status to offline without
checking for connections on other nodes in a cluster.

Now we implement a request-response mechanism for the whole
cluster and we check that before setting a user to offline.

https://mattermost.atlassian.net/browse/MM-57153

```release-note
Fix a bug where the user status would incorrectly be set to offline
without checking for connections in other nodes in an HA cluster.
```

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2024-04-30 19:28:55 +05:30
Agniva De Sarker
870cee30c6
MM-57759: Added mockery support for 1.22 (#26774)
* Revert "Revert "MM-57759: Bump mockery to version 2.42.2 to support go  1.22^" (#26772)"

This reverts commit cd3b5b46e1.

* Added the hooks.go file changes as well

```release-note
NONE
```
2024-04-13 08:15:59 +05:30
Agniva De Sarker
cd3b5b46e1
Revert "MM-57759: Bump mockery to version 2.42.2 to support go 1.22^" (#26772) 2024-04-12 15:31:24 +02:00
Ezekiel
98712737e6
MM-57759: Bump mockery to version 2.42.2 to support go 1.22^ (#26761) 2024-04-12 10:38:34 +02:00
Agniva De Sarker
efaa6264cc
MM-53032: Fix module path after repo rename (#23689)
It was a good decision in hindsight to keep the public module as 0.x
because this would have been a breaking change again.

https://mattermost.atlassian.net/browse/MM-53032
```release-note
Changed the Go module path from github.com/mattermost/mattermost-server/server/v8 to github.com/mattermost/mattermost/server/v8.

For the public facing module, it's path is also changed from github.com/mattermost/mattermost-server/server/public to github.com/mattermost/mattermost/server/public
```
2023-06-11 10:54:35 +05:30
Jesse Hallam
bb02b35048
Expose public/ API as submodule (#23345)
* model -> public/model

* plugin -> public/plugin

* public/model/utils -> public/utils

* platform/shared/mlog -> public/shared/mlog

* platform/shared/i18n -> public/shared/i18n

* platform/shared/markdown -> public/shared/markdown

* platform/services/timezones -> public/shared/timezones

* channels/einterfaces -> einterfaces

* expose public/ submodule

* go mod tidy

* .github: cache-dependency-path, setup-go-work

* modules-tidy for public/ too

* remove old gomodtidy
2023-05-10 13:07:02 -03:00
Renamed from server/channels/einterfaces/mocks/ClusterInterface.go (Browse further)