diff --git a/internal/api/handlers/actor/get_comments_test.go b/internal/api/handlers/actor/get_comments_test.go index 6773a9a..fd2b3d9 100644 --- a/internal/api/handlers/actor/get_comments_test.go +++ b/internal/api/handlers/actor/get_comments_test.go @@ -133,8 +133,8 @@ func TestGetCommentsHandler_Success(t *testing.T) { return &comments.GetActorCommentsResponse{ Comments: []*comments.CommentView{ { - URI: "at://did:plc:testuser/social.coves.community.comment/abc123", - CID: "bafytest123", + URI: "at://did:plc:testuser/social.coves.community.comment/abc123", + CID: "bafytest123", Record: &comments.CommentRecord{ Type: "social.coves.community.comment", Content: "Test comment content", diff --git a/internal/api/handlers/aggregator/apikey_handlers_test.go b/internal/api/handlers/aggregator/apikey_handlers_test.go index 0eca741..5720d6d 100644 --- a/internal/api/handlers/aggregator/apikey_handlers_test.go +++ b/internal/api/handlers/aggregator/apikey_handlers_test.go @@ -892,11 +892,11 @@ func TestGetAPIKeyResponse_OmitsEmptyOptionalFields(t *testing.T) { // mockAPIKeyService implements aggregators.APIKeyServiceInterface for testing type mockAPIKeyService struct { - generateKeyFunc func(ctx context.Context, aggregatorDID string, oauthSession *oauthlib.ClientSessionData) (plainKey string, keyPrefix string, err error) - getAPIKeyInfoFunc func(ctx context.Context, aggregatorDID string) (*aggregators.APIKeyInfo, error) - revokeKeyFunc func(ctx context.Context, aggregatorDID string) error - failedLastUsedUpdates int64 - failedNonceUpdates int64 + generateKeyFunc func(ctx context.Context, aggregatorDID string, oauthSession *oauthlib.ClientSessionData) (plainKey string, keyPrefix string, err error) + getAPIKeyInfoFunc func(ctx context.Context, aggregatorDID string) (*aggregators.APIKeyInfo, error) + revokeKeyFunc func(ctx context.Context, aggregatorDID string) error + failedLastUsedUpdates int64 + failedNonceUpdates int64 } func (m *mockAPIKeyService) GenerateKey(ctx context.Context, aggregatorDID string, oauthSession *oauthlib.ClientSessionData) (string, string, error) { diff --git a/internal/api/handlers/community/list_test.go b/internal/api/handlers/community/list_test.go index ab4b1c5..10cc3a6 100644 --- a/internal/api/handlers/community/list_test.go +++ b/internal/api/handlers/community/list_test.go @@ -129,7 +129,9 @@ func (r *listTestRepo) Subscribe(ctx context.Context, subscription *communities. func (r *listTestRepo) SubscribeWithCount(ctx context.Context, subscription *communities.Subscription) (*communities.Subscription, error) { return nil, nil } -func (r *listTestRepo) Unsubscribe(ctx context.Context, userDID, communityDID string) error { return nil } +func (r *listTestRepo) Unsubscribe(ctx context.Context, userDID, communityDID string) error { + return nil +} func (r *listTestRepo) UnsubscribeWithCount(ctx context.Context, userDID, communityDID string) error { return nil } diff --git a/internal/api/routes/user.go b/internal/api/routes/user.go index 73ca22e..faddbaa 100644 --- a/internal/api/routes/user.go +++ b/internal/api/routes/user.go @@ -18,8 +18,8 @@ import ( // UserHandler handles user-related XRPC endpoints type UserHandler struct { - userService users.UserService - userBlockRepo userblocks.Repository // Optional: for hydrating viewer.blocking on profiles + userService users.UserService + userBlockRepo userblocks.Repository // Optional: for hydrating viewer.blocking on profiles } // NewUserHandler creates a new user handler diff --git a/internal/atproto/oauth/handlers.go b/internal/atproto/oauth/handlers.go index 68d7f85..c50a355 100644 --- a/internal/atproto/oauth/handlers.go +++ b/internal/atproto/oauth/handlers.go @@ -159,11 +159,11 @@ type UserIndexer interface { type OAuthHandler struct { client *OAuthClient store oauth.ClientAuthStore - mobileStore MobileOAuthStore // For server-side CSRF validation - userIndexer UserIndexer // For indexing users after OAuth login - devResolver *DevHandleResolver // For dev mode: resolve handles via local PDS - devAuthResolver *DevAuthResolver // For dev mode: bypass HTTPS validation for localhost OAuth - allowedRedirectURIs map[string]bool // Combined allowlist for mobile + external OAuth clients + mobileStore MobileOAuthStore // For server-side CSRF validation + userIndexer UserIndexer // For indexing users after OAuth login + devResolver *DevHandleResolver // For dev mode: resolve handles via local PDS + devAuthResolver *DevAuthResolver // For dev mode: bypass HTTPS validation for localhost OAuth + allowedRedirectURIs map[string]bool // Combined allowlist for mobile + external OAuth clients } // OAuthHandlerOption is a functional option for configuring OAuthHandler diff --git a/internal/core/adminreports/service_test.go b/internal/core/adminreports/service_test.go index 40f3483..da1160a 100644 --- a/internal/core/adminreports/service_test.go +++ b/internal/core/adminreports/service_test.go @@ -347,8 +347,8 @@ func TestIsValidReason(t *testing.T) { {"illegal", true}, {"other", true}, {"invalid", false}, - {"CSAM", false}, // case-sensitive - {"Spam", false}, // case-sensitive + {"CSAM", false}, // case-sensitive + {"Spam", false}, // case-sensitive {"", false}, {" spam", false}, // with space } diff --git a/internal/core/aggregators/errors.go b/internal/core/aggregators/errors.go index 064ed3f..11150df 100644 --- a/internal/core/aggregators/errors.go +++ b/internal/core/aggregators/errors.go @@ -18,12 +18,12 @@ var ( ErrNotImplemented = errors.New("feature not yet implemented") // For Phase 2 write-forward operations // API Key authentication errors - ErrAPIKeyRevoked = errors.New("API key has been revoked") - ErrAPIKeyInvalid = errors.New("invalid API key") - ErrAPIKeyNotFound = errors.New("API key not found for this aggregator") - ErrOAuthTokenExpired = errors.New("OAuth token has expired and needs refresh") - ErrOAuthRefreshFailed = errors.New("failed to refresh OAuth token") - ErrOAuthSessionMismatch = errors.New("OAuth session DID does not match aggregator DID") + ErrAPIKeyRevoked = errors.New("API key has been revoked") + ErrAPIKeyInvalid = errors.New("invalid API key") + ErrAPIKeyNotFound = errors.New("API key not found for this aggregator") + ErrOAuthTokenExpired = errors.New("OAuth token has expired and needs refresh") + ErrOAuthRefreshFailed = errors.New("failed to refresh OAuth token") + ErrOAuthSessionMismatch = errors.New("OAuth session DID does not match aggregator DID") ) // ValidationError represents a validation error with field details diff --git a/internal/core/blueskypost/fetcher.go b/internal/core/blueskypost/fetcher.go index 1d92fe2..0874258 100644 --- a/internal/core/blueskypost/fetcher.go +++ b/internal/core/blueskypost/fetcher.go @@ -110,15 +110,15 @@ type blueskyAPIEmbedRecord struct { Record *blueskyAPIViewRecord `json:"record,omitempty"` // For record#view - direct viewRecord fields - URI string `json:"uri,omitempty"` - CID string `json:"cid,omitempty"` - Author *blueskyAPIAuthor `json:"author,omitempty"` - Value *blueskyAPIRecordValue `json:"value,omitempty"` - LikeCount int `json:"likeCount,omitempty"` - ReplyCount int `json:"replyCount,omitempty"` - RepostCount int `json:"repostCount,omitempty"` - IndexedAt string `json:"indexedAt,omitempty"` - Embeds []json.RawMessage `json:"embeds,omitempty"` + URI string `json:"uri,omitempty"` + CID string `json:"cid,omitempty"` + Author *blueskyAPIAuthor `json:"author,omitempty"` + Value *blueskyAPIRecordValue `json:"value,omitempty"` + LikeCount int `json:"likeCount,omitempty"` + ReplyCount int `json:"replyCount,omitempty"` + RepostCount int `json:"repostCount,omitempty"` + IndexedAt string `json:"indexedAt,omitempty"` + Embeds []json.RawMessage `json:"embeds,omitempty"` } // blueskyAPIViewRecord represents the viewRecord structure for quoted posts diff --git a/internal/core/communities/community.go b/internal/core/communities/community.go index 6399c30..dd385f2 100644 --- a/internal/core/communities/community.go +++ b/internal/core/communities/community.go @@ -54,40 +54,40 @@ func ResetImageProxyConfigForTesting() { // Community represents a Coves community indexed from the firehose // Communities are federated, instance-scoped forums built on atProto type Community struct { - CreatedAt time.Time `json:"createdAt" db:"created_at"` - UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` - RecordURI string `json:"recordUri,omitempty" db:"record_uri"` - FederatedFrom string `json:"federatedFrom,omitempty" db:"federated_from"` - DisplayName string `json:"displayName" db:"display_name"` - Description string `json:"description" db:"description"` - PDSURL string `json:"-" db:"pds_url"` - AvatarCID string `json:"avatarCid,omitempty" db:"avatar_cid"` - BannerCID string `json:"bannerCid,omitempty" db:"banner_cid"` - OwnerDID string `json:"ownerDid" db:"owner_did"` - CreatedByDID string `json:"createdByDid" db:"created_by_did"` - HostedByDID string `json:"hostedByDid" db:"hosted_by_did"` - PDSEmail string `json:"-" db:"pds_email"` - PDSPassword string `json:"-" db:"pds_password_encrypted"` - Name string `json:"name" db:"name"` // Short name (e.g., "gardening") - DisplayHandle string `json:"displayHandle,omitempty" db:"-"` // UI hint: !gardening@coves.social (computed, not stored) - RecordCID string `json:"recordCid,omitempty" db:"record_cid"` - FederatedID string `json:"federatedId,omitempty" db:"federated_id"` - PDSAccessToken string `json:"-" db:"pds_access_token"` - SigningKeyPEM string `json:"-" db:"signing_key_encrypted"` - ModerationType string `json:"moderationType,omitempty" db:"moderation_type"` - Handle string `json:"handle" db:"handle"` // Canonical atProto handle (e.g., gardening.community.coves.social) - PDSRefreshToken string `json:"-" db:"pds_refresh_token"` - Visibility string `json:"visibility" db:"visibility"` - RotationKeyPEM string `json:"-" db:"rotation_key_encrypted"` - DID string `json:"did" db:"did"` - ContentWarnings []string `json:"contentWarnings,omitempty" db:"content_warnings"` - DescriptionFacets []byte `json:"descriptionFacets,omitempty" db:"description_facets"` - PostCount int `json:"postCount" db:"post_count"` - SubscriberCount int `json:"subscriberCount" db:"subscriber_count"` - MemberCount int `json:"memberCount" db:"member_count"` - ID int `json:"id" db:"id"` - AllowExternalDiscovery bool `json:"allowExternalDiscovery" db:"allow_external_discovery"` - Viewer *CommunityViewerState `json:"viewer,omitempty" db:"-"` + CreatedAt time.Time `json:"createdAt" db:"created_at"` + UpdatedAt time.Time `json:"updatedAt" db:"updated_at"` + RecordURI string `json:"recordUri,omitempty" db:"record_uri"` + FederatedFrom string `json:"federatedFrom,omitempty" db:"federated_from"` + DisplayName string `json:"displayName" db:"display_name"` + Description string `json:"description" db:"description"` + PDSURL string `json:"-" db:"pds_url"` + AvatarCID string `json:"avatarCid,omitempty" db:"avatar_cid"` + BannerCID string `json:"bannerCid,omitempty" db:"banner_cid"` + OwnerDID string `json:"ownerDid" db:"owner_did"` + CreatedByDID string `json:"createdByDid" db:"created_by_did"` + HostedByDID string `json:"hostedByDid" db:"hosted_by_did"` + PDSEmail string `json:"-" db:"pds_email"` + PDSPassword string `json:"-" db:"pds_password_encrypted"` + Name string `json:"name" db:"name"` // Short name (e.g., "gardening") + DisplayHandle string `json:"displayHandle,omitempty" db:"-"` // UI hint: !gardening@coves.social (computed, not stored) + RecordCID string `json:"recordCid,omitempty" db:"record_cid"` + FederatedID string `json:"federatedId,omitempty" db:"federated_id"` + PDSAccessToken string `json:"-" db:"pds_access_token"` + SigningKeyPEM string `json:"-" db:"signing_key_encrypted"` + ModerationType string `json:"moderationType,omitempty" db:"moderation_type"` + Handle string `json:"handle" db:"handle"` // Canonical atProto handle (e.g., gardening.community.coves.social) + PDSRefreshToken string `json:"-" db:"pds_refresh_token"` + Visibility string `json:"visibility" db:"visibility"` + RotationKeyPEM string `json:"-" db:"rotation_key_encrypted"` + DID string `json:"did" db:"did"` + ContentWarnings []string `json:"contentWarnings,omitempty" db:"content_warnings"` + DescriptionFacets []byte `json:"descriptionFacets,omitempty" db:"description_facets"` + PostCount int `json:"postCount" db:"post_count"` + SubscriberCount int `json:"subscriberCount" db:"subscriber_count"` + MemberCount int `json:"memberCount" db:"member_count"` + ID int `json:"id" db:"id"` + AllowExternalDiscovery bool `json:"allowExternalDiscovery" db:"allow_external_discovery"` + Viewer *CommunityViewerState `json:"viewer,omitempty" db:"-"` } // CommunityViewerState contains viewer-specific state for community list views. diff --git a/internal/core/imageproxy/fetcher_test.go b/internal/core/imageproxy/fetcher_test.go index 50f8f75..f3dc869 100644 --- a/internal/core/imageproxy/fetcher_test.go +++ b/internal/core/imageproxy/fetcher_test.go @@ -28,7 +28,7 @@ func TestPDSFetcher_Fetch_Success(t *testing.T) { })) defer server.Close() - fetcher := NewPDSFetcher(5 * time.Second, 10) + fetcher := NewPDSFetcher(5*time.Second, 10) ctx := context.Background() data, err := fetcher.Fetch(ctx, server.URL, "did:plc:test123", "bafyreicid123") @@ -46,7 +46,7 @@ func TestPDSFetcher_Fetch_NotFound(t *testing.T) { })) defer server.Close() - fetcher := NewPDSFetcher(5 * time.Second, 10) + fetcher := NewPDSFetcher(5*time.Second, 10) ctx := context.Background() _, err := fetcher.Fetch(ctx, server.URL, "did:plc:test123", "bafyreicid123") @@ -64,7 +64,7 @@ func TestPDSFetcher_Fetch_Timeout(t *testing.T) { defer server.Close() // Use a very short timeout - fetcher := NewPDSFetcher(50 * time.Millisecond, 10) + fetcher := NewPDSFetcher(50*time.Millisecond, 10) ctx := context.Background() _, err := fetcher.Fetch(ctx, server.URL, "did:plc:test123", "bafyreicid123") @@ -74,7 +74,7 @@ func TestPDSFetcher_Fetch_Timeout(t *testing.T) { } func TestPDSFetcher_Fetch_NetworkError(t *testing.T) { - fetcher := NewPDSFetcher(5 * time.Second, 10) + fetcher := NewPDSFetcher(5*time.Second, 10) ctx := context.Background() // Use an invalid URL that will cause a network error @@ -92,7 +92,7 @@ func TestPDSFetcher_Fetch_ContextCancellation(t *testing.T) { })) defer server.Close() - fetcher := NewPDSFetcher(5 * time.Second, 10) + fetcher := NewPDSFetcher(5*time.Second, 10) ctx, cancel := context.WithCancel(context.Background()) // Cancel the context immediately @@ -114,7 +114,7 @@ func TestPDSFetcher_Fetch_ServerError(t *testing.T) { })) defer server.Close() - fetcher := NewPDSFetcher(5 * time.Second, 10) + fetcher := NewPDSFetcher(5*time.Second, 10) ctx := context.Background() _, err := fetcher.Fetch(ctx, server.URL, "did:plc:test123", "bafyreicid123") @@ -132,7 +132,7 @@ func TestPDSFetcher_Fetch_URLConstruction(t *testing.T) { })) defer server.Close() - fetcher := NewPDSFetcher(5 * time.Second, 10) + fetcher := NewPDSFetcher(5*time.Second, 10) ctx := context.Background() _, err := fetcher.Fetch(ctx, server.URL, "did:plc:abc123", "bafyreicid456") diff --git a/internal/core/imageproxy/processor_test.go b/internal/core/imageproxy/processor_test.go index 7941e75..2de1900 100644 --- a/internal/core/imageproxy/processor_test.go +++ b/internal/core/imageproxy/processor_test.go @@ -48,13 +48,13 @@ func TestProcessor_Process_CoverFit(t *testing.T) { proc := NewProcessor() tests := []struct { - name string - srcWidth int - srcHeight int - preset Preset - wantWidth int - wantHeight int - description string + name string + srcWidth int + srcHeight int + preset Preset + wantWidth int + wantHeight int + description string }{ { name: "landscape image to square avatar", diff --git a/internal/core/userblocks/errors.go b/internal/core/userblocks/errors.go index 9fc6bbf..eb8eab2 100644 --- a/internal/core/userblocks/errors.go +++ b/internal/core/userblocks/errors.go @@ -23,4 +23,3 @@ func IsNotFound(err error) bool { func IsConflict(err error) bool { return errors.Is(err, ErrBlockAlreadyExists) } - diff --git a/internal/core/userblocks/service_test.go b/internal/core/userblocks/service_test.go index a53da8c..9d1fdea 100644 --- a/internal/core/userblocks/service_test.go +++ b/internal/core/userblocks/service_test.go @@ -16,13 +16,13 @@ import ( // --- Mock Repository --- type mockRepo struct { - blockUserFn func(ctx context.Context, block *UserBlock) (*UserBlock, error) - unblockUserFn func(ctx context.Context, blockerDID, blockedDID string) error - getBlockFn func(ctx context.Context, blockerDID, blockedDID string) (*UserBlock, error) - getBlockByURIFn func(ctx context.Context, recordURI string) (*UserBlock, error) - listBlockedFn func(ctx context.Context, blockerDID string, limit, offset int) ([]*UserBlock, error) - isBlockedFn func(ctx context.Context, blockerDID, blockedDID string) (bool, error) - areBlockedFn func(ctx context.Context, blockerDID string, blockedDIDs []string) (map[string]bool, error) + blockUserFn func(ctx context.Context, block *UserBlock) (*UserBlock, error) + unblockUserFn func(ctx context.Context, blockerDID, blockedDID string) error + getBlockFn func(ctx context.Context, blockerDID, blockedDID string) (*UserBlock, error) + getBlockByURIFn func(ctx context.Context, recordURI string) (*UserBlock, error) + listBlockedFn func(ctx context.Context, blockerDID string, limit, offset int) ([]*UserBlock, error) + isBlockedFn func(ctx context.Context, blockerDID, blockedDID string) (bool, error) + areBlockedFn func(ctx context.Context, blockerDID string, blockedDIDs []string) (map[string]bool, error) } func (m *mockRepo) BlockUser(ctx context.Context, block *UserBlock) (*UserBlock, error) { diff --git a/internal/core/users/user.go b/internal/core/users/user.go index d2a71f7..03578ab 100644 --- a/internal/core/users/user.go +++ b/internal/core/users/user.go @@ -79,7 +79,7 @@ type ProfileViewDetailed struct { Stats *ProfileStats `json:"stats,omitempty"` DisplayName string `json:"displayName,omitempty"` // Bio is the user's biography/description. Maps to JSON "description" for atProto lexicon compatibility. - Bio string `json:"description,omitempty"` + Bio string `json:"description,omitempty"` Avatar string `json:"avatar,omitempty"` // URL, not CID Banner string `json:"banner,omitempty"` // URL, not CID Viewer *ProfileViewerState `json:"viewer,omitempty"` diff --git a/internal/web/handlers.go b/internal/web/handlers.go index 62a9ed7..b4fe130 100644 --- a/internal/web/handlers.go +++ b/internal/web/handlers.go @@ -51,8 +51,8 @@ func (h *Handlers) LandingHandler(w http.ResponseWriter, r *http.Request) { } data := LandingPageData{ - Title: "Coves - Community-Driven Forums on atProto", - Description: "Coves is a forum-like social app built on the AT Protocol. Join communities, share content, and own your data.", + Title: "Coves - Community-Driven Forums on atProto", + Description: "Coves is a forum-like social app built on the AT Protocol. Join communities, share content, and own your data.", AppStoreURL: "https://apps.apple.com/app/coves-social/id6758530907", PlayStoreURL: "https://play.google.com/store/apps/details?id=social.coves", } diff --git a/tests/integration/bluesky_post_test.go b/tests/integration/bluesky_post_test.go index 5209dac..8b68e97 100644 --- a/tests/integration/bluesky_post_test.go +++ b/tests/integration/bluesky_post_test.go @@ -70,7 +70,7 @@ func TestBlueskyPostCrossPosting_URLParsing(t *testing.T) { invalidURLs := []string{ "https://twitter.com/user/status/123", "https://example.com/post/123", - "https://bsky.app/profile/user", // Missing post path + "https://bsky.app/profile/user", // Missing post path "http://bsky.app/profile/user/post/123", // Wrong scheme "", } diff --git a/tests/integration/comment_e2e_test.go b/tests/integration/comment_e2e_test.go index e6233e3..3ba1779 100644 --- a/tests/integration/comment_e2e_test.go +++ b/tests/integration/comment_e2e_test.go @@ -1227,4 +1227,3 @@ func TestCommentE2E_ValidationErrors(t *testing.T) { } }) } - diff --git a/tests/integration/community_suggestion_e2e_test.go b/tests/integration/community_suggestion_e2e_test.go index 48eb22e..77e66f9 100644 --- a/tests/integration/community_suggestion_e2e_test.go +++ b/tests/integration/community_suggestion_e2e_test.go @@ -21,14 +21,14 @@ import ( // suggestionResponse represents the JSON response for a single community suggestion type suggestionResponse struct { - ID int64 `json:"id"` - Title string `json:"title"` - Description string `json:"description"` - SubmitterDID string `json:"submitterDid"` - Status string `json:"status"` - VoteCount int `json:"voteCount"` - CreatedAt string `json:"createdAt"` - UpdatedAt string `json:"updatedAt"` + ID int64 `json:"id"` + Title string `json:"title"` + Description string `json:"description"` + SubmitterDID string `json:"submitterDid"` + Status string `json:"status"` + VoteCount int `json:"voteCount"` + CreatedAt string `json:"createdAt"` + UpdatedAt string `json:"updatedAt"` Viewer *struct { Vote *int `json:"vote"` } `json:"viewer"` diff --git a/tests/integration/community_v2_validation_test.go b/tests/integration/community_v2_validation_test.go index c2722a1..0ee2cc4 100644 --- a/tests/integration/community_v2_validation_test.go +++ b/tests/integration/community_v2_validation_test.go @@ -274,7 +274,7 @@ func TestCommunityConsumer_HandleField(t *testing.T) { Record: map[string]interface{}{ "$type": "social.coves.community.profile", "handle": "c-gamingtest.coves.social", // atProto handle (DNS-resolvable) - "name": "gamingtest", // Short name for !mentions + "name": "gamingtest", // Short name for !mentions "createdBy": "did:plc:user123", "hostedBy": "did:web:coves.social", "visibility": "public", diff --git a/tests/integration/image_proxy_e2e_test.go b/tests/integration/image_proxy_e2e_test.go index 594e1ae..66a858e 100644 --- a/tests/integration/image_proxy_e2e_test.go +++ b/tests/integration/image_proxy_e2e_test.go @@ -504,7 +504,7 @@ func createImageProxyTestServerWithCache(t *testing.T, pdsURL string, identityRe cache, err := imageproxycore.NewDiskCache(cacheDir, 1, 0) require.NoError(t, err, "Failed to create disk cache") // 1GB max processor := imageproxycore.NewProcessor() - fetcher := imageproxycore.NewPDSFetcher(30 * time.Second, 10) + fetcher := imageproxycore.NewPDSFetcher(30*time.Second, 10) config := imageproxycore.Config{ Enabled: true, CachePath: cacheDir, @@ -568,7 +568,7 @@ func TestImageProxy_MockPDS(t *testing.T) { cache, err := imageproxycore.NewDiskCache(cacheDir, 1, 0) require.NoError(t, err, "Failed to create disk cache") processor := imageproxycore.NewProcessor() - fetcher := imageproxycore.NewPDSFetcher(30 * time.Second, 10) + fetcher := imageproxycore.NewPDSFetcher(30*time.Second, 10) config := imageproxycore.Config{ Enabled: true, CachePath: cacheDir, @@ -660,7 +660,7 @@ func TestImageProxy_ErrorHandling(t *testing.T) { cache, err := imageproxycore.NewDiskCache(cacheDir, 1, 0) require.NoError(t, err, "Failed to create disk cache") processor := imageproxycore.NewProcessor() - fetcher := imageproxycore.NewPDSFetcher(1 * time.Second, 10) // Short timeout + fetcher := imageproxycore.NewPDSFetcher(1*time.Second, 10) // Short timeout config := imageproxycore.Config{ Enabled: true, CachePath: cacheDir, @@ -773,7 +773,7 @@ func TestImageProxy_UnsupportedFormat(t *testing.T) { cache, err := imageproxycore.NewDiskCache(cacheDir, 1, 0) require.NoError(t, err, "Failed to create disk cache") processor := imageproxycore.NewProcessor() - fetcher := imageproxycore.NewPDSFetcher(30 * time.Second, 10) + fetcher := imageproxycore.NewPDSFetcher(30*time.Second, 10) config := imageproxycore.DefaultConfig() service, err := imageproxycore.NewService(cache, processor, fetcher, config) @@ -841,7 +841,7 @@ func TestImageProxy_LargeImage(t *testing.T) { cache, err := imageproxycore.NewDiskCache(cacheDir, 1, 0) require.NoError(t, err, "Failed to create disk cache") processor := imageproxycore.NewProcessor() - fetcher := imageproxycore.NewPDSFetcher(30 * time.Second, 10) + fetcher := imageproxycore.NewPDSFetcher(30*time.Second, 10) config := imageproxycore.DefaultConfig() service, err := imageproxycore.NewService(cache, processor, fetcher, config) @@ -907,7 +907,7 @@ func TestImageProxy_ResponseJSON(t *testing.T) { cache, err := imageproxycore.NewDiskCache(cacheDir, 1, 0) require.NoError(t, err, "Failed to create disk cache") processor := imageproxycore.NewProcessor() - fetcher := imageproxycore.NewPDSFetcher(1 * time.Second, 10) + fetcher := imageproxycore.NewPDSFetcher(1*time.Second, 10) config := imageproxycore.DefaultConfig() service, err := imageproxycore.NewService(cache, processor, fetcher, config) diff --git a/tests/integration/post_creation_test.go b/tests/integration/post_creation_test.go index fe28dfc..659a911 100644 --- a/tests/integration/post_creation_test.go +++ b/tests/integration/post_creation_test.go @@ -144,9 +144,9 @@ func TestPostCreation_Basic(t *testing.T) { // Extract name from handle: "c-gardening.coves.social" -> "gardening" // Scoped format: !gardening@coves.social handleParts := strings.Split(testCommunity.Handle, ".") - communityNameWithPrefix := handleParts[0] // "c-gardening" + communityNameWithPrefix := handleParts[0] // "c-gardening" communityName := strings.TrimPrefix(communityNameWithPrefix, "c-") // "gardening" - instanceDomain := strings.Join(handleParts[1:], ".") // "coves.social" + instanceDomain := strings.Join(handleParts[1:], ".") // "coves.social" scopedHandle := fmt.Sprintf("!%s@%s", communityName, instanceDomain) req := posts.CreatePostRequest{