Commit Graph

70 Commits (89a0aa3bf732d3bda0ddef6058b4ecd44ea7c217)

Author SHA1 Message Date
Your Name 8a2649b3ff feat: add critical path test suite and fix auth/config issues
Test Infrastructure:
- Modernize phpunit.xml (bootstrap, source block, Laravel 12 env vars)
- Configure tests/Pest.php with pest()->extend(TestCase::class)->in('Feature')
- Add docker-compose.test.yml (Redis for test suite)
- Add composer test/test:quick scripts
- Rename CACHE_DRIVER to CACHE_STORE across config (backwards compatible)
- Update .env.testing for in-memory SQLite + Docker Redis

Test Coverage (190 tests):
- CriticalRoutes: public routes, auth routes, API endpoints, middleware, schedule
- Auth/LoginTest: login, logout, rate limiting, redirect behavior
- Auth/RegisterTest: registration flow, validation, disabled registration
- Auth/PasswordResetTest: reset request, token validation, password update
- Auth/TwoFactorTest: 2FA checkpoint, setup behind password confirmation
- Auth/PasswordConfirmationTest: sudo mode flow via Laravel password.confirm
- Api/ScopeTest: scope enforcement, public endpoints, admin access

Bugs Fixed:
- Fix unauthenticated API returning 500 instead of 401 (AuthenticationException
  not handled in custom exception renderer in bootstrap/app.php)
- Replace custom DangerZone middleware with Laravel password.confirm
- Add HasFactory trait to Profile model for test factories

Bugs Documented (known-bugs group):
- Registration crashes with str_ends_with TypeError (RegisterController:82)
- OAuth routes use legacy array syntax causing ReflectionFunction TypeError
4 weeks ago
Your Name f2159197e8 fix: add return type declarations to Eloquent relation methods
Larastan 3.x requires explicit return types on relation methods to
verify relation existence when using with(), has(), etc. This adds
the appropriate return type declarations to all relation methods
flagged by the larastan.relationExistence rule.

Models fixed:
- Profile (avatar, statuses)
- User (profile)
- Status (profile, media, hashtags)
- DirectMessage (status, author, recipient)
- Report (reporter, status, reportedUser)
- Like (actor, status)
- Media (status)
- Notification (item)
- HashtagFollow (hashtag)
- OauthClient (user)
- Story (profile)
- StatusHashtag (status, hashtag, profile, media)
- AccountInterstitial (user)
- Hashtag (posts)
- CustomFilter (keywords)
- CustomFilterKeyword (customFilter)
- AdminShadowFilter (profile)
- ImportPost (status)
4 weeks ago
Your Name c807a8524c refactor: replace short facade aliases with fully-qualified imports
Convert all 273 short facade alias imports (e.g. 'use Cache;') to their
fully-qualified class names (e.g. 'use Illuminate\Support\Facades\Cache;')
across 193 files.

This resolves 643 PHPStan 'class.notFound' errors caused by the static
analyzer being unable to resolve global aliases, and aligns with modern
Laravel conventions. It also unblocks removing the aliases array from
config/app.php in a future change.

All 107 tests pass.
1 month ago
Shift 19880c2ffb
Convert string references to `::class`
PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.
1 month ago
Your Name 2f06f30508 fix 7 months ago
Daniel Supernault 53742fa699
Lint 9 months ago
Your Name 4b14819923 Larastan: Add @property 11 months ago
dansup 225e835015
Staging (#6264)
* StatusPipeline defensive checks

* HomeFeedPipeline defensive checks

* DeletePipeline defensive checks

* InboxPipeline defensive checks

* MediaPipeline defensive checks

* PushNotificationPipeline defensive checks

* LikePipeline defensive checks

* FollowPipeline defensive checks

* ImageOptimizePipeline defensive checks

* Misc pipelines defensive checks

* Update CommentPipeline.php

* Update FollowPushNotifyPipeline.php

* Update LikePushNotifyPipeline.php

* Update FollowPushNotifyPipeline.php

* Update MentionPushNotifyPipeline.php

* Update MoveSendUndoFollowPipeline.php

* Update RemoteFollowPipeline.php

* Update FollowPushNotifyPipeline.php

* Update LikePushNotifyPipeline.php

* Update MentionPushNotifyPipeline.php

* Update Site/Config.php - config_cache only has 1 arg. No fallback.

* Update Bouncer.php - Called 'count' on Laravel collection, but could have been retrieved as a query.            🪪  larastan.noUnnecessaryCollectionCall

* Update Status.php - Missing use App\Models\Conversation;

* Larastan: Update UndoSharePipeline.php (Undefined variable: $status)

* Update ResilientMediaStorageService.php

* Update ImageS3UploadPipeline.php

* Larastan: Update Profile.php missing "use App\Avatar;"

* Larastan: Update MediaStorageService.php

* Larastan: Update MediaPathService.php

* Update MediaPathService.php

* Update MediaStorageService.php

* Update ImageS3UploadPipeline.php

* Larastan: Update AddUserDomainBlock.php

```
 ------ ------------------------------------------------------------- 
  Line   Console/Commands/AddUserDomainBlock.php                      
 ------ ------------------------------------------------------------- 
  37     Variable $domain in empty() always exists and is not falsy.  
         🪪  empty.variable                                           
 ------ ------------------------------------------------------------- 
```

* Larastan: Update CatchUnoptimizedMedia.php

```
 ------ ------------------------------------------------------------------------------------------------- 
  Line   Console/Commands/CatchUnoptimizedMedia.php                                                       
 ------ ------------------------------------------------------------------------------------------------- 
  31     Constructor of class App\Console\Commands\CatchUnoptimizedMedia has an unused parameter $media.  
         🪪  constructor.unusedParameter                                                                  
 ------ ------------------------------------------------------------------------------------------------- 
```

* Update DeleteUserDomainBlock.php

* Update StatusHashtag.php

* Update FixLikes.php

* Update User.php

* Update Installer.php

* Update SeedFollows.php

* Update DiscoverCategory.php

* Update FollowRequest.php

* Update Follower.php

* Update AccountController.php

* Update CustomFilterKeyword.php

* Update FederationController.php

* Update Inbox.php

* Update HttpSignature.php

---------

Co-authored-by: Your Name <you@example.com>
Co-authored-by: Shlee <github@shl.ee>
11 months ago
Daniel Supernault dc7973de62
Update Profile model, add aliases relation 3 years ago
Daniel Supernault 2cbf1acec3
Update profile 3 years ago
Daniel Supernault ab9a8ba314
Update Profile 3 years ago
Daniel Supernault b1f95a7213
Bump laravel, v9 => v10 3 years ago
Daniel Supernault 28bf8649b3
Update Profile model, fix avatar url path generation. Fixes #4041, Fixes #4031, Fixes #3523 4 years ago
Daniel Supernault 620ee826d1
Update profile model, improve avatarUrl fallback 4 years ago
Daniel Supernault 989e42497a
Update Profile, fix avatarUrl paths. Fixes #3559 #3634 4 years ago
Daniel Supernault 672f7c8ce0
Fix remote avatar urls when not using cloud storage 4 years ago
Daniel Supernault a73b2f0002
Update Profile model 4 years ago
Daniel Supernault 505261dab1
Refactor AP profileFetch logic to fix race conditions and improve updating fields and avatars 4 years ago
Daniel Supernault a64aef6726
Update Profile model, cast last_status_at as timestamp 5 years ago
Daniel Supernault 32995064ec
Update Profile model 5 years ago
Daniel Supernault ee9f079551
Update Profile, fix following count bug 5 years ago
Daniel Supernault e5aea490b1
Refactor snowflake id generation to improve randomness 5 years ago
Daniel Supernault ca5d964f5f
Update Profile model 5 years ago
Daniel Supernault 5916f8c76a
Update Profile model, fix getAudienceInbox method 5 years ago
Daniel Supernault 22257cc2a7
Update FollowerService, cache audience 5 years ago
Daniel Supernault 5ac9d0e8f2
Update Embeds. Fix Profile + Status embeds, remove following count and improve cache invalidation and hidden follower counts 6 years ago
Daniel Supernault ea8e426174
Update Profile model, use cdn_url for avatars 6 years ago
Daniel Supernault 6dcd472be6
Update Profile, fix status count 6 years ago
Daniel Supernault f6528c8470
Update avatars, use jpeg default 6 years ago
Daniel Supernault d06bec9cd9
Update Profile, fix follower counter bug 6 years ago
Daniel Supernault 4a14e970f0
Update Profile model, improve counter caching 6 years ago
Daniel Supernault 6969bb5bb4
Update Profile model, cast timestamp for last_fetched_at 7 years ago
Daniel Supernault 0eae9f8b78
Update Profile model, use change_count for version 7 years ago
Daniel Supernault a34f38633c
Update Profile model, add reported relationship 7 years ago
Daniel Supernault 7faa9d8e61
Add S3 + Stories 7 years ago
Daniel Supernault 396848b20b
Update Media, Profile models, fix S3 urls 7 years ago
Daniel Supernault a5a5224d0d
Update Profile model, add hasFollowRequestById method 7 years ago
Daniel Supernault 64926762f2
Update Profile model, add collections relation 7 years ago
Daniel Supernault 62dbf81a5b
Update Profile model to use snowflake ids 7 years ago
Daniel Supernault 506208f545
Update account settings, add hashtags to relationships 7 years ago
Daniel Supernault abec5e4861
Update Profile model 7 years ago
Daniel Supernault 377394f0f2
Update AccountTransformer, cache status count 7 years ago
Daniel Supernault 339a0a3882
Update NotificationService 7 years ago
Daniel Supernault 0c300ceeee
Update Profile model 8 years ago
Daniel Supernault 4739c25fe0
Update Cache, prepare for laravel 5.8 8 years ago
Daniel Supernault dd42ad7558
Update Profile model, add circles relation 8 years ago
Daniel Supernault dc2a3da72d
Update Profile Model 8 years ago
Daniel Supernault 1cba67b781
Update Profile model 8 years ago
Daniel Supernault 825fcd6fe4
Update Profile model 8 years ago
Daniel Supernault 908740b46f
Update Profile model 8 years ago