Skip to main content
Common issues and solutions when developing mobile backends with Mizu.

Device Detection Issues

Device is nil

Problem: DeviceFromCtx(c) returns nil. Cause: Mobile middleware not applied. Solution:

Wrong Platform Detected

Problem: Platform is unknown or incorrect. Cause: Missing headers or User-Agent not recognized. Solution:
  1. Ensure client sends X-Platform header
  2. Check User-Agent format
  3. Enable User-Agent parsing: SkipUserAgent: false

Version Middleware Issues

Version Always Default

Problem: VersionFromCtx(c) always returns default version. Cause: Client not sending version header. Solution:
Client should send:

Unsupported Version Error

Problem: 400 error for valid version. Cause: Version not in Supported list. Solution:

Push Notification Issues

Invalid Token Format

Problem: Token validation fails. Cause: Token format doesn’t match provider. Solution:

Provider Not Detected

Problem: PushProvider is empty. Cause: Platform not set or unknown. Solution:

AASA Not Served

Problem: /.well-known/apple-app-site-association returns 404. Cause: Middleware not configured or path conflict. Solution:
Problem: Links open in browser instead of app. Causes:
  1. AASA not accessible over HTTPS
  2. Invalid AASA format
  3. App not installed
Solution:
  1. Verify AASA is served: curl https://yourdomain.com/.well-known/apple-app-site-association
  2. Validate format: Apple Validation Tool
  3. Check app entitlements

Sync Issues

Token Always Empty

Problem: req.Token is always empty. Cause: Token not sent in correct location. Solution:
Client should send:
Or:

Full Sync Every Time

Problem: Always getting full sync instead of delta. Cause: Token not stored or sent incorrectly. Solution:
  1. Store token after each sync
  2. Send token on next request
  3. Check full_sync query param not set

Error Response Issues

Error Format Wrong

Problem: Error response not matching expected format. Cause: Not using mobile.SendError. Solution:

Trace ID Missing

Problem: Error responses don’t include trace ID. Solution:

Debug Logging

Add logging middleware to debug issues:

Testing Endpoints

Test with curl

Simulate Mobile Request

Next Steps

Headers

Header reference

API Reference

Complete API documentation