mattermost/server/public/pluginapi
Pavel Zeman 3e2c3f70c2
Some checks are pending
API / build (push) Waiting to run
Server CI / Compute Go Version (push) Waiting to run
Server CI / Check mocks (push) Blocked by required conditions
Server CI / Check go mod tidy (push) Blocked by required conditions
Server CI / check-style (push) Blocked by required conditions
Server CI / Check serialization methods for hot structs (push) Blocked by required conditions
Server CI / Vet API (push) Blocked by required conditions
Server CI / Check migration files (push) Blocked by required conditions
Server CI / Generate email templates (push) Blocked by required conditions
Server CI / Check store layers (push) Blocked by required conditions
Server CI / Check mmctl docs (push) Blocked by required conditions
Server CI / Postgres with binary parameters (push) Blocked by required conditions
Server CI / Postgres (shard 0) (push) Blocked by required conditions
Server CI / Postgres (shard 1) (push) Blocked by required conditions
Server CI / Postgres (shard 2) (push) Blocked by required conditions
Server CI / Postgres (shard 3) (push) Blocked by required conditions
Server CI / Merge Postgres Test Results (push) Blocked by required conditions
Server CI / Postgres (FIPS) (push) Blocked by required conditions
Server CI / Generate Test Coverage (push) Blocked by required conditions
Server CI / Run mmctl tests (push) Blocked by required conditions
Server CI / Run mmctl tests (FIPS) (push) Blocked by required conditions
Server CI / Build mattermost server app (push) Blocked by required conditions
Web App CI / check-lint (push) Waiting to run
Web App CI / check-i18n (push) Blocked by required conditions
Web App CI / check-external-links (push) Blocked by required conditions
Web App CI / check-types (push) Blocked by required conditions
Web App CI / test (platform) (push) Blocked by required conditions
Web App CI / test (mattermost-redux) (push) Blocked by required conditions
Web App CI / test (channels shard 1/4) (push) Blocked by required conditions
Web App CI / test (channels shard 2/4) (push) Blocked by required conditions
Web App CI / test (channels shard 3/4) (push) Blocked by required conditions
Web App CI / test (channels shard 4/4) (push) Blocked by required conditions
Web App CI / upload-coverage (push) Blocked by required conditions
Web App CI / build (push) Blocked by required conditions
fix: prevent sql.DB connectionCleaner race and harden flaky tests (#35891)
* fix: prevent sql.DB connectionCleaner race with testify mock diffing

The previous fix (#35881) moved store.Close()/th.Shutdown() before
AssertExpectations, but the race actually occurs earlier — during
mock.Called() when RegisterDBCollector fires inside initConnection.

Root cause: testify's Arguments.Diff() unconditionally calls
fmt.Sprintf("%v", *sql.DB) on every recorded argument (mock.go:976),
which uses reflect to read sql.DB internal fields. The connectionCleaner
goroutine concurrently writes to those same fields, triggering a DATA
RACE under Go 1.25's stricter race detector.

Fix: Set ConnMaxLifetimeMilliseconds=0 and ConnMaxIdleTimeMilliseconds=0
in test SqlSettings before initConnection. This prevents the
connectionCleaner goroutine from starting at all — no concurrent writer
means no race. Connection pool cleanup serves no purpose in tests.

For store_test.go: settings are set directly before SqlStore creation.
For platform tests: settings are set in setupTestHelper's config before
sqlstore.New() is called via platform.New().

Co-authored-by: Claude <claude@anthropic.com>

* fix: harden flaky TestScheduleOnceSequential and TestGroupStore tests

TestScheduleOnceSequential: Replace fixed 300ms sleep with
require.Eventually polling (5s timeout, 50ms interval). Under the race
detector, execution is significantly slower and 25+ scheduled jobs may
not complete within a fixed 300ms window.

TestGroupStore/GetGroups: Use unique uid-prefixed display names for
test groups to avoid collisions with groups created by other parallel
subtests sharing the same database. Search queries and result checks
updated to use the uid prefix.

Co-authored-by: Claude <claude@anthropic.com>

* fix: address CodeRabbit review feedback

- Restore mixed-case search coverage in TestGroupStore by using
  mixed-case query strings (uid + "-GrOuP-3") to verify
  case-insensitive matching behavior.
- Strengthen exactly-once validation in TestScheduleOnceSequential
  by checking callback count == 1 instead of > 0, ensuring
  duplicate executions are caught.

Co-authored-by: Claude <claude@anthropic.com>

---------

Co-authored-by: Claude <claude@anthropic.com>
2026-03-31 16:58:09 -04:00
..
cluster fix: prevent sql.DB connectionCleaner race and harden flaky tests (#35891) 2026-03-31 16:58:09 -04:00
experimental [MM-67739] Rename SlackAttachment to MessageAttachment across the codebase (#35445) 2026-03-10 16:37:21 +01:00
i18n Enforce use of any instead of interface{} (#30588) 2025-03-31 10:44:34 +02:00
bot.go Profile image from bytes (#26610) 2024-03-28 10:56:55 +00:00
bot_test.go Profile image from bytes (#26610) 2024-03-28 10:56:55 +00:00
channel.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
channel_test.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
client.go MM-67793: Remove dependency on blang/semver/v4 (#35742) 2026-03-25 13:41:33 +00:00
cluster.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
cluster_test.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
configuration.go Enforce use of any instead of interface{} (#30588) 2025-03-31 10:44:34 +02:00
email.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
emoji.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
emoji_test.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
error.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
example_client_test.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
file.go Adding SetFileSearchableContent plugin API endpoint (#24355) 2023-08-30 13:43:40 -07:00
file_test.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
frontend.go feat: pluginapi: filewillbedownloaded / sendtoastmessage (#34596) 2026-02-16 17:10:39 +01:00
group.go New pluginapi method for syncables (#30790) 2025-05-21 14:44:34 -04:00
kv.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
kv_memory.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
kv_memory_test.go updated go to version 1.25.8 (#35817) 2026-03-27 21:11:52 +01:00
kv_test.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
license.go Renamed premium SKU to Enterprise Advanced (#30882) 2025-05-02 11:34:46 +05:30
license_test.go Renamed premium SKU to Enterprise Advanced (#30882) 2025-05-02 11:34:46 +05:30
log.go Enforce use of any instead of interface{} (#30588) 2025-03-31 10:44:34 +02:00
logrus.go Enforce use of any instead of interface{} (#30588) 2025-03-31 10:44:34 +02:00
logrus_test.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
oauth.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
plugin_test.go [MM-54014] Run tests in public/... (#24320) 2023-08-22 12:48:53 +02:00
plugins.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
post.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
post_test.go [MM-62427] Add message attachments validation (#30180) 2025-03-20 12:53:50 +01:00
property.go Change properties search signature to support multiple TargetIDs (#33873) 2025-09-11 22:56:01 +00:00
property_test.go Change properties search signature to support multiple TargetIDs (#33873) 2025-09-11 22:56:01 +00:00
session.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
slashcommand.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
store.go MM-63368: Remove MySQL (#33458) 2025-07-22 20:40:55 +05:30
store_test.go fix(pluginapi/store): init master db if no replica (#29674) 2025-01-02 13:51:22 +05:30
system.go MM-67793: Remove dependency on blang/semver/v4 (#35742) 2026-03-25 13:41:33 +00:00
system_test.go Migrate from gopkg.in/yaml.v3 to github.com/goccy/go-yaml (#34510) 2025-11-18 08:52:05 +01:00
team.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
team_test.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00
user.go PluginAPI: add ability to retrieve users by ids (#26936) 2024-05-15 07:06:40 -07:00
user_test.go PluginAPI: add ability to retrieve users by ids (#26936) 2024-05-15 07:06:40 -07:00
utils.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
utils_test.go [MM-53968] Includes mattermost-plugin-api into the mono repo (#24235) 2023-08-21 09:50:30 +02:00