tracker
All repositories: gitoria
1.8 KB
// tracker#62: native lookups preserve map winners and creation conflict suffixes.import { personsTable, showsTable } from '../lib/shows.hl'import { personBySlug, personIdByTmdb, castPersonId, guestPersonId } from '../lib/people.hl'static check = (Boolean ok, String message) => { if (!ok) { hlError(message) } }static run = () => {for (p of [{ id = 'index-first' oldId = 'index-first' name = 'Same Name' urlSegment = 'Same-Name' tmdbId = 87650001 }{ id = 'index-last' oldId = 'index-last' name = 'Same Name' urlSegment = 'Same-Name' tmdbId = 87650001 }{ id = 'index-suffix' oldId = 'index-suffix' name = 'Same Name' urlSegment = 'Same-Name-2' tmdbId = 87650002 }]) { check(personsTable.put(p) != null, 'seed') }check(personBySlug('Same-Name').id == 'index-last', 'last slug winner')check(personIdByTmdb(87650001) == 'index-last', 'last TMDB winner')check(personIdByTmdb('87650001') == 'index-last', 'TMDB string coercion')check(personBySlug('missing') == null && personBySlug('') == null && personBySlug(null) == null, 'absent slug')check(personIdByTmdb(87659999) == null, 'absent TMDB')c = { tmdbId = 87650003 name = 'Same Name' character = 'Role' }id = castPersonId(&c, null)check(id != null && personBySlug('Same-Name-3').id == id, 'conflict suffix')check(castPersonId(&c, null) == id, 'repeat cast import')check(guestPersonId(87650003, null).created == false, 'known guest')s = { id = 'index-show' oldId = 'index-show' cast = [{ tmdbId = 87650004 actor = 'Same Name' character = 'Guest' }] }check(showsTable.put(s) != null, 'guest show')g = guestPersonId(87650004, 'index-show')check(g.created && personBySlug('Same-Name-4').id == g.id, 'new guest')check(guestPersonId(87650004, 'index-show').created == false, 'guest revisit')check(personIdByTmdb(87650004) == g.id, 'new guest TMDB lookup')personsTable.persist()console.log('person-index: passed')return true}run()
Branches
Latest commits
- 1ef7a3b1RV44: report day44 gates and migration/restart proofsmre
- a5f62f6cRV44: re-vendor Hybriel set day44 (source 222edef7, bin 4f0f263e)mre
- 6159a248Merge branch 'hm62-personindex' into rv44mre
- a8923d93log: RV44 startedmre
- cf28cf77mission RV44mre
- 585782dfLog: tracker#60 Chrome look, STATUS rewrittenmre
- 147d0172conductor: caramboleyo is the user, not owner/creatorApollo
- 21dd0cfblog: #60 live measurement, reviewmre
- 7793cf94HM62b report: person indexes with fixed mpackdbmre
- b4c8d3a9Document tracker#62 fixed-index migration and GC proofmre
- 09d66ed5status: #60 livemre
- 4171672flog: #60 livemre
- f52862a2log: HM62b startedmre
- 88fde2c4mission HM62bmre
- a722e526log: #62 blocked by hybriel#317mre
- 074a7418log: #62 assigned to Tracker; pending rulemre
- 06f6ae8fHM62 report: mpackdb index gapmre
- 66f83de3WIP tracker#62 native person indexes blocked by schema migration gapmre
- 380ba349Merge packed people order for tracker#62mre
- 86fe5430log: HM62 startedmre