knilink Github contribution chart
knilink Github Stats
knilink Most Used Languages

Activity

26 Sep 2022

Issue Comment

Knilink

Support Firefox in Flatpak (if possible)

In a similar way to #325, it would be nice if this could work with Firefox that is running in a Flatpak, if at all possible.

Forked On 26 Sep 2022 at 01:14:19

Knilink

adding ~/.var/app/org.mozilla.firefox/.mozilla/firefox and /var/lib/flatpak/exports/bin/org.mozilla.firefox works for me

Commented On 26 Sep 2022 at 01:14:19

Knilink

[ADS-7207]fix: some sonar cloud bugs

fix two sonarCloud bugs

Description

https://adslot.atlassian.net/browse/ADS-7207

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

Manual testing step?

Screenshots (if appropriate):

Merged On 21 Sep 2022 at 02:24:16

Knilink

Commented On 21 Sep 2022 at 02:24:16

Knilink

[ADS-7207]fix: some sonar cloud bugs

fix two sonarCloud bugs

Description

https://adslot.atlassian.net/browse/ADS-7207

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

Manual testing step?

Screenshots (if appropriate):

Merged On 21 Sep 2022 at 02:19:46

Knilink

Commented On 21 Sep 2022 at 02:19:46
Merge

Knilink

[ADS-7207]fix: some sonar cloud bugs

fix two sonarCloud bugs

Description

https://adslot.atlassian.net/browse/ADS-7207

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

Manual testing step?

Screenshots (if appropriate):

Forked On 21 Sep 2022 at 02:19:45

Knilink

`_.remove` will mutate `selectedItems` maybe `const updatedItems = _.reject(selectedItems, { id: item.id });` instead
On 21 Sep 2022 at 02:19:45

Knilink

fix: more secure regex

Remove potential security risk

Merged On 31 Aug 2022 at 01:26:27

Knilink

Commented On 31 Aug 2022 at 01:26:27

Knilink

feat: search button and footer text props

Pushed On 23 Aug 2022 at 01:08:35

Knilink

Merge pull request #1468 from Adslot/searchable-checklist-footer-button-props

Button and footer text props for searchable checklist

Pushed On 23 Aug 2022 at 01:08:35

Knilink

fix: fix minor issues found by code scanner

Pushed On 23 Aug 2022 at 01:08:35
Issue Comment

Knilink

async_hooks issues

Hi!

Thanks for this great library!

Unfortunately I have the same problem as mentioned here: #2404

I.e. the query-finish callback is called in a different execution context. Or something. I find the async hooks confusing but I need them to track which sql queries were initiated by which request in my api.

I have something reproducible!

const pg = require('pg')
const {AsyncLocalStorage} = require('async_hooks')

const asyncLocalStorage = new AsyncLocalStorage()

function getExecId() {
	return asyncLocalStorage.getStore()
}

async function sleep(ms) {
	return new Promise((resolve, reject) => {
		setTimeout(() => resolve(), ms)
	})
}

const pool = new pg.Pool({
	host: 'localhost',
	port: 5432,
	user: '...',
	password: '...',
	database: '...',
})

function doThings(id) {
	asyncLocalStorage.run(id, async () => {
		// everything in here should always see the same value from `getExecId()`
		console.log('query starts in', getExecId())
		pool.query('SELECT 1', r => {
			console.log('query finished in', getExecId())
		})
		console.log('finish', getExecId())
	})
}

;(async () => {
	doThings(1)
	await sleep(1000)
	console.log('')
	doThings(2)
})() 

Output is

query starts in 1
finish 1
query finished in 1

query starts in 2
finish 2
query finished in 1     <--- should be 2 as well 

This shows that the callback for pool.query is in the wrong context.

I think this can be solved in the library by having some class inherit AsyncResource and then calling runInAsyncScope for that callback, see here for an example.

Forked On 18 Aug 2022 at 02:00:30

Knilink

one workaround is

import { promisify, callbackify } from 'node:util';
callbackify(promisify(pool.query)).call(pool, ...); 

as mentioned in the doc "Context loss" sesstion:

If your code is callback-based, it is enough to promisify it with util.promisify() so it starts working with native promises.

so promisify seems to be able to recover the context.

Commented On 18 Aug 2022 at 02:00:30

Knilink

test: build

Pushed On 16 Aug 2022 at 04:02:40

Knilink

test: build

Pushed On 16 Aug 2022 at 03:56:52

Knilink

fix: minor fix

Pushed On 14 Aug 2022 at 10:55:11

Knilink

fix: minor fix

Pushed On 12 Aug 2022 at 07:28:26

Knilink

fix: minor fix

Created On 12 Aug 2022 at 07:24:03
Create Branch
Knilink In Adslot/adslot-ui Create Branchfix-minor

Knilink

Core component library. By Adslot

On 12 Aug 2022 at 07:22:39