Added more Sentry message filtering, improved PDF metadata analysis
This commit is contained in:
parent
5fc81b82a8
commit
d0eafe76c8
|
@ -36,7 +36,7 @@ function Page(props: PageProps): JSX.Element {
|
||||||
<a href="https://github.com/billylo1/covidpass" className="underline">{t('common:gitHub')}</a>
|
<a href="https://github.com/billylo1/covidpass" className="underline">{t('common:gitHub')}</a>
|
||||||
<a href="https://vaccine-ontario.ca" className="underline">{t('common:returnToMainSite')}</a>
|
<a href="https://vaccine-ontario.ca" className="underline">{t('common:returnToMainSite')}</a>
|
||||||
</nav>
|
</nav>
|
||||||
<div className="flex pt-4 flex-row space-x-4 justify-center text-md flex-wrap">Last updated: 2021-10-06 (v1.9.19)</div>
|
<div className="flex pt-4 flex-row space-x-4 justify-center text-md flex-wrap">Last updated: 2021-10-06 (v1.9.20)</div>
|
||||||
</footer>
|
</footer>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -58,12 +58,13 @@ async function detectReceiptType(fileBuffer : ArrayBuffer): Promise<string> {
|
||||||
const pdfDocument = await loadingTask.promise;
|
const pdfDocument = await loadingTask.promise;
|
||||||
const pdfPage = await pdfDocument.getPage(1); //first page
|
const pdfPage = await pdfDocument.getPage(1); //first page
|
||||||
const content = await pdfPage.getTextContent();
|
const content = await pdfPage.getTextContent();
|
||||||
|
const docMetadata = await pdfDocument.getMetadata();
|
||||||
const numItems = content.items.length;
|
const numItems = content.items.length;
|
||||||
if (numItems == 0) { // QC has no text items
|
if (numItems == 0) { // QC has no text items
|
||||||
console.log('detected QC');
|
console.log('detected QC');
|
||||||
Sentry.setContext("QC-pdf-metadata", {
|
Sentry.setContext("QC-pdf-metadata", {
|
||||||
numPages: pdfDocument.numPages,
|
numPages: pdfDocument.numPages,
|
||||||
docMetadata: await pdfDocument.getMetadata()
|
docMetadata: JSON.stringify(docMetadata)
|
||||||
});
|
});
|
||||||
Sentry.captureMessage('QC PDF Metadata for structure analysis');
|
Sentry.captureMessage('QC PDF Metadata for structure analysis');
|
||||||
console.log(`PDF details: numPages=${pdfDocument.numPages}`);
|
console.log(`PDF details: numPages=${pdfDocument.numPages}`);
|
||||||
|
@ -79,7 +80,7 @@ async function detectReceiptType(fileBuffer : ArrayBuffer): Promise<string> {
|
||||||
|
|
||||||
Sentry.setContext("BC-pdf-metadata", {
|
Sentry.setContext("BC-pdf-metadata", {
|
||||||
numPages: pdfDocument.numPages,
|
numPages: pdfDocument.numPages,
|
||||||
docMetadata: await pdfDocument.getMetadata()
|
docMetadata: JSON.stringify(docMetadata)
|
||||||
});
|
});
|
||||||
Sentry.captureMessage('BC PDF Metadata for structure analysis');
|
Sentry.captureMessage('BC PDF Metadata for structure analysis');
|
||||||
|
|
||||||
|
@ -88,7 +89,7 @@ async function detectReceiptType(fileBuffer : ArrayBuffer): Promise<string> {
|
||||||
// possible missed QC PDF?
|
// possible missed QC PDF?
|
||||||
Sentry.setContext("Possible-missed-QC-pdf-metadata", {
|
Sentry.setContext("Possible-missed-QC-pdf-metadata", {
|
||||||
numPages: pdfDocument.numPages,
|
numPages: pdfDocument.numPages,
|
||||||
docMetadata: await pdfDocument.getMetadata(),
|
docMetadata: JSON.stringify(docMetadata),
|
||||||
matchedValue: value
|
matchedValue: value
|
||||||
});
|
});
|
||||||
Sentry.captureMessage('Possible missed QC PDF Metadata for structure analysis');
|
Sentry.captureMessage('Possible missed QC PDF Metadata for structure analysis');
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Integrations } from '@sentry/tracing';
|
||||||
|
|
||||||
export const initSentry = () => {
|
export const initSentry = () => {
|
||||||
SentryModule.init({
|
SentryModule.init({
|
||||||
release: 'grassroots_covidpass@1.9.19', // App version. Needs to be manually updated as we go unless we make the build smarter
|
release: 'grassroots_covidpass@1.9.20', // App version. Needs to be manually updated as we go unless we make the build smarter
|
||||||
dsn: 'https://7120dcf8548c4c5cb148cdde2ed6a778@o1015766.ingest.sentry.io/5981424',
|
dsn: 'https://7120dcf8548c4c5cb148cdde2ed6a778@o1015766.ingest.sentry.io/5981424',
|
||||||
integrations: [
|
integrations: [
|
||||||
new Integrations.BrowserTracing(),
|
new Integrations.BrowserTracing(),
|
||||||
|
@ -11,6 +11,7 @@ export const initSentry = () => {
|
||||||
ignoreErrors: [
|
ignoreErrors: [
|
||||||
'cancelled',
|
'cancelled',
|
||||||
'annulé',
|
'annulé',
|
||||||
|
'已取消',
|
||||||
'invalidFileType',
|
'invalidFileType',
|
||||||
'request timed out',
|
'request timed out',
|
||||||
'blocked by content blocker',
|
'blocked by content blocker',
|
||||||
|
|
Loading…
Reference in New Issue