Remove subscription_stability_test.go and improve test variable naming
Some checks failed
Go / build-and-release (push) Has been cancelled

Deleted `subscription_stability_test.go` to clean up unused or redundant code. Updated naming in test files for improved readability, replacing `tag` with `tg` for consistency. Also updated the `github.com/klauspost/compress` dependency to v1.18.2.
This commit is contained in:
2025-12-01 18:47:15 +00:00
parent 869006c4c3
commit 2166ff7013
12 changed files with 81 additions and 547 deletions

View File

@@ -896,7 +896,7 @@ func TestFollowsWhitelistAdminsWithWriteAllow(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
// Generate if needed
if tt.signer.Pub() == nil {
tt.signer.Generate()
_ = tt.signer.Generate()
}
ev := createTestEventForNewFields(t, tt.signer, "test", 1)

View File

@@ -87,7 +87,7 @@ type Rule struct {
ReadDeny []string `json:"read_deny,omitempty"`
// MaxExpiry is the maximum expiry time in seconds for events written to the relay. If 0, there is no maximum expiry. Events must have an expiry time if this is set, and it must be no more than this value in the future compared to the event's created_at time.
// Deprecated: Use MaxExpiryDuration instead for human-readable duration strings.
MaxExpiry *int64 `json:"max_expiry,omitempty"`
MaxExpiry *int64 `json:"max_expiry,omitempty"` //nolint:staticcheck // Intentional backward compatibility
// MaxExpiryDuration is the maximum expiry time in ISO-8601 duration format.
// Format: P[n]Y[n]M[n]W[n]DT[n]H[n]M[n]S (e.g., "P7D" for 7 days, "PT1H" for 1 hour, "P1DT12H" for 1 day 12 hours).
// Parsed into maxExpirySeconds at load time.
@@ -152,7 +152,7 @@ func (r *Rule) hasAnyRules() bool {
len(r.readAllowBin) > 0 || len(r.readDenyBin) > 0 ||
r.SizeLimit != nil || r.ContentLimit != nil ||
r.MaxAgeOfEvent != nil || r.MaxAgeEventInFuture != nil ||
r.MaxExpiry != nil || r.MaxExpiryDuration != "" || r.maxExpirySeconds != nil ||
r.MaxExpiry != nil || r.MaxExpiryDuration != "" || r.maxExpirySeconds != nil || //nolint:staticcheck // Backward compat
len(r.MustHaveTags) > 0 ||
r.Script != "" || r.Privileged ||
r.WriteAllowFollows || len(r.FollowsWhitelistAdmins) > 0 ||
@@ -226,9 +226,9 @@ func (r *Rule) populateBinaryCache() error {
} else {
r.maxExpirySeconds = &seconds
}
} else if r.MaxExpiry != nil {
} else if r.MaxExpiry != nil { //nolint:staticcheck // Backward compatibility
// Fall back to MaxExpiry (raw seconds) if MaxExpiryDuration not set
r.maxExpirySeconds = r.MaxExpiry
r.maxExpirySeconds = r.MaxExpiry //nolint:staticcheck // Backward compatibility
}
// Compile IdentifierRegex pattern
@@ -956,7 +956,7 @@ func (sr *ScriptRunner) readResponses() {
}
// logOutput logs the output from stderr
func (sr *ScriptRunner) logOutput(stdout, stderr io.ReadCloser) {
func (sr *ScriptRunner) logOutput(_ /* stdout */, stderr io.ReadCloser) {
defer stderr.Close()
// Only log stderr, stdout is used by readResponses