Block banned-country locations and align GraphQL ops

Defense-in-depth banned-country gate covering every entry point that could
set a location Feeld's policy disallows (~60 countries from their support
article):

- New src/config/bannedCountries.ts — single source of truth (ISO codes + aliases)
- New src/utils/reverseGeocode.ts — Nominatim reverse lookup w/ localStorage cache
- New src/api/links/bannedCountryLink.ts — Apollo link chokepoint; intercepts
  every DeviceLocationUpdate mutation and refuses to forward if reverse-geocode
  resolves to a banned country. Catches Settings, Discover, Likes scanner, and
  ApiExplorer raw GraphQL alike.
- useLocation.tsx — setLocation throws BannedCountryError; saveLocation gate;
  sanitize banned entries on localStorage and server hydration
- Settings.tsx — block at search, saved-location pick, and save-current
- Likes.tsx — skip banned saved locations in scanForLikes and "Fuck It" scan
- server/index.js — PUT /api/saved-locations filters; readSavedLocations
  filters legacy banned entries so rotation cron is safe too
- nginx.conf — route additions for new backend endpoints

Plus the broader rc/realign-graphql-ops session work: GraphQL query/mutation
realignment after Feeld API changes, ApiExplorer updates, Profile/Discover/Likes
refinements, useFavorites hook, dataSync extensions, vite proxy adjustments.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Trey T
2026-06-01 18:30:37 -05:00
parent f84786e654
commit da2bab21e5
21 changed files with 1646 additions and 531 deletions
@@ -12,6 +12,10 @@ interface ProfileDetailModalProps {
profileId: string;
onClose: () => void;
onMatch?: () => void;
// Fires after any committed action on this profile (like, ping, dislike).
// Used by the Saved tab to auto-remove the profile from favorites after
// an action is taken from within the modal.
onActionTaken?: (action: 'like' | 'ping' | 'dislike') => void;
}
const styles = {
@@ -521,7 +525,7 @@ const styles = {
},
};
export function ProfileDetailModal({ profileId, onClose, onMatch }: ProfileDetailModalProps) {
export function ProfileDetailModal({ profileId, onClose, onMatch, onActionTaken }: ProfileDetailModalProps) {
const [currentPhotoIndex, setCurrentPhotoIndex] = useState(0);
const [isClosing, setIsClosing] = useState(false);
const [showPingModal, setShowPingModal] = useState(false);
@@ -606,6 +610,7 @@ export function ProfileDetailModal({ profileId, onClose, onMatch }: ProfileDetai
if (data.profileLike.status === 'MATCHED') {
onMatch?.();
}
onActionTaken?.('like');
handleClose();
},
});
@@ -617,6 +622,7 @@ export function ProfileDetailModal({ profileId, onClose, onMatch }: ProfileDetai
await addSentPing(viewingProfileId, profile?.imaginaryName);
refetchAccount();
setShowPingModal(false);
onActionTaken?.('ping');
handleClose();
}
},
@@ -637,6 +643,7 @@ export function ProfileDetailModal({ profileId, onClose, onMatch }: ProfileDetai
});
console.log('Disliked profile:', profile?.imaginaryName);
}
onActionTaken?.('dislike');
handleClose();
},
});