fix(cache): cached results on the same request #1393
in local:
go to SitesCacheService.ts and modify the function getAllRepoData()
export async function getAllRepoData(
accessToken: string | undefined
): Promise<RepositoryData[]> {
console.log({ accessToken }) // this one is local dev hor dont push to production
// wait until time is a mutliple of 5 seconds
const now = Date.now()
const waitTime = 5000 - (now % 5000)
await new Promise((resolve) => setTimeout(resolve, waitTime))
const { repos: firstPageRepos, links } = await fetchPageOfRepositories({
accessToken,
page: 1,
getLinks: true,
})
console.log(firstPageRepos)
if (!links?.last || links.last.pagenum <= 1) {
// There are no links, or no last link specifically, which is the behaviour when the page returned is the last page
// (In the same manner has the links for the first page do not prev and first links)
return firstPageRepos
}
// There are more pages to retrieve! Fetch all pages 2 to N in parallel, as was done before
const pageNums = _.range(2, links.last.pagenum + 1)
const pages2ToLast = await Promise.all(
pageNums.map((page) => fetchPageOfRepositories({ accessToken, page }))
)
pages2ToLast.map((res) => console.log(res.repos))
return firstPageRepos.concat(...pages2ToLast.map((res) => res.repos))
}
Create 2 different Github users with two different access permissions (on two different browers) and spam the /sites page.
assert that the pages returned are accurate to what the user expects.
In staging:
1.Login via github for a NON admin user, assert that you do not see any sites
Login via github for a admin user, assert that you do see all sites
feat: create form to send email to all site collaborators #1368
Log in to the Staging CMS and go to the jacob-staging site
Add yourself as a collaborator (provided that you are an Isomer Admin), remove the others if needed
New
#1394
#1393
#1387
#1390
#1389
#1388
#1386
#1368
#1385
Tests
fix(cache): cached results on the same request
#1393
in local:
go to
SitesCacheService.ts
and modify the functiongetAllRepoData()
Create 2 different Github users with two different access permissions (on two different browers) and spam the
/sites
page. assert that the pages returned are accurate to what the user expects.In staging: 1.Login via github for a NON admin user, assert that you do not see any sites
feat: create form to send email to all site collaborators
#1368
jacob-staging
siteDeploy Notes
feat: create form to send email to all site collaborators
#1368
New environment variables:
NOTIFY_SITE_COLLABORATORS_FORM_KEY
: Form secret key for the notify site collaborators formfetch_ssm_parameters.sh
)Full Changelog: https://github.com/isomerpages/isomercms-backend/compare/v0.87.0..v0.88.0