text:
Taproot script path spend doesn't work as expected.

I'm writing a simple demo showing the usage of "Taproot script path spend".
(like this article A Guide to creating TapRoot Scripts with bitcoinjs-lib but using scure-btc-signer)
const internalPrivateKey = secp256k1.utils.randomPrivateKey()
const internalPublicKey = schnorr.getPublicKey(internalPrivateKey)
const internalP2tr = btc.p2tr(internalPublicKey, undefined, btc.TEST_NETWORK)

// pay-to-pubkey spend path
const script = btc.Script.encode([ internalPublicKey, 'CHECKSIG' ])
const scriptP2tr = btc.p2tr(internalPublicKey, { script }, btc.TEST_NETWORK, true)

// deposit some btc to scriptP2tr.address
// ...

// spend it
const tx = new btc.Transaction({ allowUnknowInput: true })
tx.addInput({
  txid: 'xxx',
  index: 0,
  witnessUtxo: {
    amount: 10000n,
    script: scriptP2tr.script,
  },
  tapLeafScript: scriptP2tr.tapLeafScript,
  sequence: 0xfffffffd,
})
tx.addOutputAddress(
  'tb1pxxx',
  9000n,
  btc.TEST_NETWORK,
)
tx.signIdx(internalPrivateKey, 0)
tx.finalize()
console.log('tx:', tx.id, tx.hex)

It throws with the error: "No taproot scripts signed".
The main issue is here:
https://github.com/paulmillr/scure-btc-signer/blob/e9fdfbc1fe8ce43efa384e1f433f72c21ce25562/index.ts#L2301-L2309
getTaprootKeys function changes the privateKey and publicKey (tweaked with the empty merkleRoot because the schnorrPub and cb.internalKey are the same: internalPublicKey here). So the new tweaked publicKey doesn't match the one in the script (const script = btc.Script.encode([ internalPublicKey, 'CHECKSIG' ])) and it skips thinking there is no public key in tapLeafScript.
If I change the codes eliminating the tweak (getTaprootKeys function does here), keeping the privateKey and publicKey the internal one (internalPrivateKey and internalPublicKey), the demo codes work as expected.
My question is that why tweak the keys here if schnorrPub and cb.internalKey are the same? In my demo, they are the same, being internalPublicKey.

@finian

const scriptP2tr = btc.p2tr(internalPublicKey, { script }, btc.TEST_NETWORK, true)

The code looks very weird, since it will be 'A or A' (same key) multisig, which works as Key-spend and Script-spend at the same time.
Please use library API, instead of creating the script manually:
const script = btc.Script.encode([ internalPublicKey, 'CHECKSIG' ])
can be written as:
btc.p2tr_pk(internalPublicKey)
Also, you are missing other fields from scriptP2tr.

My question is that why tweak the keys here if schnorrPub and cb.internalKey are the same? In my demo, they are the same, being internalPublicKey.

Because 'internalKey' is key before tweak and you need to tweak it to get real key.
Here examples how you can do Key-spend / Script-spend / (Script+Key)-spend using library API:

const regtest = { bech32: 'bcrt', pubKeyHash: 0x6f, scriptHash: 0xc4 };
const internalPrivateKey = secp256k1.utils.randomPrivateKey();
const internalPublicKey = schnorr.getPublicKey(internalPrivateKey);

// Key-spend
{
  const scriptP2tr = btc.p2tr(internalPublicKey, undefined, regtest, true);
  const tx = new btc.Transaction({ allowUnknowInput: true });
  tx.addInput({
    txid: 'c061c23190ed3370ad5206769651eaf6fac6d87d85b5db34e30a74e0c4a6da3e',
    index: 0,
    witnessUtxo: {
      amount: 10000n,
      script: scriptP2tr.script,
    },
    ...scriptP2tr,
    sequence: 0xfffffffd,
  });
  tx.addOutputAddress(
    'bcrt1pea3850rzre54e53eh7suwmrwc66un6nmu9npd7eqrhd6g4lh8uqsxcxln8',
    9000n,
    regtest
  );
  tx.signIdx(internalPrivateKey, 0);
  tx.finalize();
  console.log('tx1:', tx.id, tx.hex);
}
// Script-spend
{
  const scriptP2tr = btc.p2tr(undefined, btc.p2tr_pk(internalPublicKey), regtest, true);
  const tx = new btc.Transaction({ allowUnknowInput: true });
  tx.addInput({
    txid: 'c061c23190ed3370ad5206769651eaf6fac6d87d85b5db34e30a74e0c4a6da3e',
    index: 0,
    witnessUtxo: {
      amount: 10000n,
      script: scriptP2tr.script,
    },
    ...scriptP2tr,
    sequence: 0xfffffffd,
  });
  tx.addOutputAddress(
    'bcrt1pea3850rzre54e53eh7suwmrwc66un6nmu9npd7eqrhd6g4lh8uqsxcxln8',
    9000n,
    regtest
  );
  tx.signIdx(internalPrivateKey, 0);
  tx.finalize();
  console.log('tx2:', tx.id, tx.hex);
}
// Or even both (but kinda pointless, since same key): can be spent by using key or script
{
  const scriptP2tr = btc.p2tr(internalPublicKey, btc.p2tr_pk(internalPublicKey), regtest, true);
  const tx = new btc.Transaction({ allowUnknowInput: true });
  tx.addInput({
    txid: 'c061c23190ed3370ad5206769651eaf6fac6d87d85b5db34e30a74e0c4a6da3e',
    index: 0,
    witnessUtxo: {
      amount: 10000n,
      script: scriptP2tr.script,
    },
    ...scriptP2tr,
    sequence: 0xfffffffd,
  });
  tx.addOutputAddress(
    'bcrt1pea3850rzre54e53eh7suwmrwc66un6nmu9npd7eqrhd6g4lh8uqsxcxln8',
    9000n,
    regtest
  );
  tx.signIdx(internalPrivateKey, 0);
  tx.finalize();
  console.log('tx3:', tx.id, tx.hex);
}
/*
tx1: 62c4ee8db462610f38f51ef6ca445ad43b45ae70ac6c5b7701027f9eca626e64 020000000001013edaa6c4e0740ae334dbb5857dd8c6faf6ea5196760652ad7033ed9031c261c00000000000fdffffff012823000000000000225120cf627a3c621e695cd239bfa1c76c6ec6b5c9ea7be16616fb201ddba457f73f010140efc6ba21cf1d84cc4f5206b1c6a30048760c6cdf31582dc806d4497ef46cd462e75b1c49facf481c23fa4a32f28cfd1052be3f3073029aa7c2dad17aeffc8a8700000000
tx2: 62c4ee8db462610f38f51ef6ca445ad43b45ae70ac6c5b7701027f9eca626e64 020000000001013edaa6c4e0740ae334dbb5857dd8c6faf6ea5196760652ad7033ed9031c261c00000000000fdffffff012823000000000000225120cf627a3c621e695cd239bfa1c76c6ec6b5c9ea7be16616fb201ddba457f73f010340f61af68e54b468d0eed288f1b08f997b391d20c5de4cdba84f97d1e6740eab52c47047b1529d067342817e173ee1c90651814c6e00e89119b1159d1e56bf97052220b1537f2baaded53dca0b8eac10304712b9ce2dd26efa73c2e70eb644591a4539ac21c050929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac000000000
tx3: 62c4ee8db462610f38f51ef6ca445ad43b45ae70ac6c5b7701027f9eca626e64 020000000001013edaa6c4e0740ae334dbb5857dd8c6faf6ea5196760652ad7033ed9031c261c00000000000fdffffff012823000000000000225120cf627a3c621e695cd239bfa1c76c6ec6b5c9ea7be16616fb201ddba457f73f0101407fe329753f5a3be9eb9113697f96888e2a72f6b4a6c80edfa76950b71de01c85104816f304fd4f3ebbd5d26c97a45c692b53c6bb68d415bb4a7a62505cc28fe500000000
*/

@paulmillr Thanks for your replies.

The code looks very weird, since it will be 'A or A' (same key) multisig, which works as Key-spend and Script-spend at the same time.

It might be weird but it's a valid usage scenario.

Please use library API, instead of creating the script manually:

Actually I have removed extra opcodes in the script to keep the demo codes simple.

Because 'internalKey' is key before tweak and you need to tweak it to get real key.

Yes it's true for key path spending but NOT for the script path spending.
Say we have an internalKey P0, a publicKey P1 in script1 and a publicKey P2 in script2.
When we spend using script2, we'll sign the tx with the privateKey corresponding to the P2. It's nothing to do with the internalKey P0, not to mention tweaking the P2.
So we should not tweak the key when dealing with the script path spending, just sign as is.
https://github.com/paulmillr/scure-btc-signer/blob/e9fdfbc1fe8ce43efa384e1f433f72c21ce25562/index.ts#L2301-L2306
The third example codes you provided is actually using the key path spending. If we use script path spending, it will hit the issue: "No taproot scripts signed":
// Or even both (but kinda pointless, since same key): can be spent by using key or script
{
  const scriptP2tr = btc.p2tr(internalPublicKey, btc.p2tr_pk(internalPublicKey), regtest, true);
  const tx = new btc.Transaction({ allowUnknowInput: true });
  tx.addInput({
    txid: 'c061c23190ed3370ad5206769651eaf6fac6d87d85b5db34e30a74e0c4a6da3e',
    index: 0,
    witnessUtxo: {
      amount: 10000n,
      script: scriptP2tr.script,
    },
    ...scriptP2tr,
    tapInternalKey: undefined, // <-- here we force a `script path spending`
    sequence: 0xfffffffd,
  });
  tx.addOutputAddress(
    'bcrt1pea3850rzre54e53eh7suwmrwc66un6nmu9npd7eqrhd6g4lh8uqsxcxln8',
    9000n,
    regtest
  );
  tx.signIdx(internalPrivateKey, 0);
  tx.finalize();
  console.log('tx3:', tx.id, tx.hex);
}

It might be weird but it's a valid usage scenario.

It is possible to create by protocol level, but discouraged (from BIP-0341):

If one or more of the spending conditions consist of just a single key (after aggregation), the most likely one should be made the internal key.

It is impossible to create this tx by using library API, you are just corrupting output of p2tr:

    tapInternalKey: undefined, // <-- here we force a `script path spending`

Do you have a real, or at least reasonable) use case where this feature is required?

The third example codes you provided is actually using the key path spending. If we use script path spending, it will hit the issue: "No taproot scripts signed":

It is because there is no reason to use script path spending if you can use key path spending:

Script path will require more fees and space on blockchain.
Code which re-uses internal key inside leaf scripts is either:

a mistake: leaf script can be removed without affecting actual logic, just creating outputs which will require more fee to spend.
a security error: if internal key is accidentally set as one of keys from multi-sig or other complex logic.
In this case owner of internal key can spend whole output without any signatures from other wallets.

So we should not tweak the key when dealing with the script path spending, just sign as is.

This specific code looks like a leftover from support of nested p2tr inputs (which is unsupported now), so we will remove it. But your use-case looks like a mistake, forcing library to spend more fees than required.

My demo codes are from this article: https://dev.to/eunovo/a-guide-to-creating-taproot-scripts-with-bitcoinjs-lib-4oph (source codes: https://github.com/Eunovo/taproot-with-bitcoinjs/blob/main/src/index.ts)
I've tested it with different libs including bitcoinjs-lib, tapscript etc. and I failed with scure-btc-signer.

It is because there is no reason to use script path spending if you can use key path spending:

Script path will require more fees and space on blockchain.
Code which re-uses internal key inside leaf scripts is either:

a mistake: leaf script can be removed without affecting actual logic, just creating outputs which will require more fee to spend.
a security error: if internal key is accidentally set as one of keys from multi-sig or other complex logic.
In this case owner of internal key can spend whole output without any signatures from other wallets.

Yes, you are totally right. In practice, we may not construct scripts like that, but still, I think it's valid according to BIP-0341 (though it's discouraged).

We prevent users from doing weird things that degrade security. I think it's fine to not match BIP, esp when it's discouraged there.

authors: finian paulmillr

repo: paulmillr/scure-btc-signer


text:
tokeniser accesses codePtr

Need a general check.

Changed to use .cget macro ; only memory.flat directly accesses codePtr

source: gharchive/issue

repo: paulscottrobson/superbasic

license: MIT

license_type: permissive

license_source: github-api


text:
Why are underscores removed?

Hi there,
Thanks for this amazing library! I'm wondering why the tokenise method replaces underscores with space words = string.strip().replace('_', ' ').split()? This is not parameterized and even with unknown=True and strict=False these are removed. Our use case needs to preserve underscores. Happy to submit a PR if that would be helpful, I just want to understand why this is happening.
Thanks!

Thank you! I am happy you find the package useful! :green_heart:
To be honest, I cannot remember why this is the case. There is a commit from 2017 where I explicitly add the underscore as a word boundary char; I guess because of a dataset I was working with at the time.
At any rate, you are right, underscores should be treated just like any other unknown char; and the unknown and strict flags should indeed have a say in how it is handled. You are welcome to submit a PR if you have the time to! If not, I will take care of it and make a new release next weekend. Thank you for raising this issue!

Done, the latest version handles underscores as any other unknown character. Thank you again for raising this issue! (:

Thanks so much @pavelsof ! Sorry I didn't get around to making the PR myself - you were too quick. It's much appreciated though. Thanks again for the great library.

authors: pavelsof roedoejet

repo: pavelsof/ipatok


text:
Lens size

Hi, I was looking for an option which let me set the size of the lens. Can you help me with that? Thank you!

If make this simple, then I can tell that - lens size depends on scale value and shows what part of image is zoomed/scaled in preview.
To control this on opening, you have an option defaultScale for now. I think all of this stuff with scale need to be extended to have more control options. But this will come in future releases soon.

no matter what value I am using for defaultScale there is no change in the result

I have created a working example for you in xzoom-sandbox. Please check it here: https://github.com/payalord/xzoom-sandbox/tree/master/DefaultScale
It shows that lens size is possible to change by default scale in range -100% to +100%.

authors: bdolleschal payalord

repo: payalord/xZoom

license_source: bigquery


text:
Refactoring + Async Iterable interface added

A bit of cleaning.
Solved the takers/racers multicasting problem (which I discussed by email with joe), giving priority to takers.
It should be a 'patch' update.
[Edit]
Async iterable interface added.
It should be a 'minor' update.

Sorry, I'm not the best with git stuff and the two pull request have been merged together

source: gharchive/pull-request

repo: paybase/csp

license: mit


text:
Date picker and dates don't follow users language

Bug Report
Recently I reported the issue of the Date picker field not being localized and you released an update fixing it on the 1.6.6 release. However, the localization only occurs when you enable the localization option of the payload.config.ts file, but it doesn't localize it if you have it disabled and the user has their Admin UI language set to any other than English.
My customers mainly use Spanish-only content, so I don't need to enable the localization feature, but I do need the Admin UI to be in Spanish. So if I choose to have the Admin UI in Spanish under my account's preferences, all of the date pickers and every place where the date gets displayed is still in English. See video for context:
https://user-images.githubusercontent.com/47041342/217619798-6f34218b-9206-45b9-a136-2319137bc6e0.mp4
As you can see, I don't have content localization enabled, but I do have my user set to Spanish and I still get al of the dates formatted in English as well as the date picker. I hope I was able to explain myself correctly.
Steps to Reproduce

Create a simple Payload project without localization enabled
Create a collection with a date field
In the Admin UI, set your user's language preference to Spanish.
Go to any place where a date is displayed or use a date picker, they're still in English.

Other Details

Payload: 1.6.6

Crystal clear. We're on it. Thank you for the detailed write-up. Expect a fix shortly!

repo: payloadcms/payload


text:
Array type misbehaving in admin UI

Link to reproduction
https://github.com/payloadcms/payload/tree/master/test/fields/collections/Array
To Reproduce
Create a collection with an array with a single text field.
Create a new collection, and add two items to the array and save. The text field can have any value.
Remove the most recently added array item using the drop down menu in the ui and save again.
Minimal collection config
const Entry: CollectionConfig = {   slug: "entry",   admin: {useAsTitle:'hello',defaultColumns:["hello"]},   fields:[{name:'hello',type:'array',fields:[{name:'title',type:'text'}]}] }
According to jesschow in the payload discord this is reproducible with the fields test suite > array collection.
Describe the Bug
After pressing save the deleted item reappears. If you have two items and delete both of them, one reappears. If you have only one item and you delete it, it gets properly deleted. Issue is not present in 1.10.5 so this is a regression.
Payload Version
1.11.2

Happens to us in 1.11.2 as well, had to downgrade

Can confirm we also experience this, right now we're working around it, using a beforeChange hook on the array field:
import type { FieldHook } from "payload/types";

export const arrayDeleteEmptyObjectsHook: FieldHook<any, any[], any> = (
  args
) => {
  const { value, data, siblingData, originalDoc, operation, req } = args;
  return value.filter((v) => Object.keys(v).length > 1);
};

authors: choutkamartin mj3052 rhysmakesthings


text:
plugin-form-builder: A dependency in @payloadcms/plugin-form-builder@1.0.15 has a severe vulnerability

Link to reproduction
No response
Describe the Bug
I am attempting to download @payloadcms/plugin-form-builder@1.0.15, however my organization doesn't allow me due to a a severe vulnerability for a dependency (sharp@0.31.3).

To Reproduce
Install the plugin and note the security vulnerability reported by npm
Payload Version
2.4.0
Adapters and Plugins
@payloadcms/plugin-form-builder@1.0.15

Sharp dep has since been bumped to 0.32.6

authors: AshtarCodes denolfe


text:
Cannot customize root level admin route

Describe the Bug
Following https://payloadcms.com/docs/beta/admin/overview#customizing-root-level-routes does not allow updating routes.admin

It's not allowed by Typescript
It cannot find a place to put import map as the admin folder was moved

Link to the code that reproduces this issue
https://github.com/payloadcms/payload/blob/a8569b9e782ca70bcdbb2f7f6aaf5e1b98f949d7/packages/payload/src/bin/generateImportMap/index.ts#L177-L180
Reproduction Steps

Move any files from src/app/(payload)/admin one folder up
Set routes.admin = '/' in payload config
Start dev server

Which area(s) are affected? (Select all that apply)
area: core
Environment Info
Binaries:
Node: 22.5.1
npm: 10.8.2
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
payload: 3.0.0-beta.117
next: 15.0.1
@payloadcms/db-mongodb: 3.0.0-beta.117
@payloadcms/email-nodemailer: 3.0.0-beta.117
@payloadcms/graphql: 3.0.0-beta.117
@payloadcms/next/utilities: 3.0.0-beta.117
@payloadcms/plugin-cloud: 3.0.0-beta.117
@payloadcms/richtext-lexical: 3.0.0-beta.117
@payloadcms/translations: 3.0.0-beta.117
@payloadcms/ui/shared: 3.0.0-beta.117
react: 19.0.0-rc-65a56d0e-20241020
react-dom: 19.0.0-rc-65a56d0e-20241020

Is this a duplicate of #7803?

Setting routes.admin on the top level (note: not inside admin) worked for me just fine on the latest beta TS wise
Yeah I can confirm this is an issue and duplicate of ^

Will look into the attached PR, closing this and we'll track progress in that issue

authors: jeffreylouden paulpopus thgh


text:
feat: folder enabled collections

Excited for folders!!!

authors: JarrodMFlesch himanshu-ntml


text:
refactor: (template/webiste) access reuse authenticated

What?
reuse authenticated access check in extended authenricatedOrPublished access check
Why?
reduce redundancy

Thank you for your PR but I think here it's fine for them to be separate functions. A lot of people use our templates to learn so I think it's better we keep things simple and clear where possible.

authors: ahmedrowaihi paulpopus


text:
[Typescript] Fixes to the type definitions in index.d.ts

downshift version: latest
node version: 8
npm (or yarn) version: npm

Relevant code or config
#407
What you did:
Fixed existing types and added missing types in index.d.ts
What happened:
Some type definitions in index.d.ts were either not accurate or missing.

Reproduction repository:

Problem description:
Suggested solution:

:tada: This issue has been resolved in version 2.0.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:

authors: franklixuefei kentcdodds

repo: paypal/downshift


text:
Unable to customize payment methods

Is your feature request related to a problem? Please describe.
Currently, there's a limitation with Paytrail integration in WooCommerce where merchants cannot select specific payment methods to offer to their customers. This results in a situation where all payment methods defined in the Merchant Dashboard are enforced enabled, leading to a lack of flexibility. For instance, if a merchant manages multiple WooCommerce online stores, they are compelled to provide payment methods that might not be relevant or usable for certain customer groups.
Describe the solution you'd like
To address this issue, i propose adding an option within the plugin's settings that allows merchants to customize the available payment methods. This can be achieved by incorporating checkboxes next to each payment method, enabling merchants to selectively enable or disable them based on their preferences and customer needs.
Potential Benefits:

Enhanced flexibility: Merchants can tailor the payment methods offered to align with their business model and customer preferences.
Improved customer experience: By providing only relevant payment methods, the checkout process becomes smoother and more intuitive for customers.
Better alignment with business goals: Merchants can optimize their payment offerings to encourage desired payment behaviors and streamline operations.

Describe alternatives you've considered

Grouping payment methods: Alternatives such as grouping payment methods into categories like Banks, Cards, Mobile Payments, and Financing can provide additional organization and clarity.
Individual customization: Alternatively, allowing merchants to customize payment methods individually, providing granular control over the available options.

Additional context
By implementing this feature, merchants using Paytrail integration in WooCommerce can efficiently manage their payment methods, enhancing both operational efficiency and customer satisfaction.
This is implemented, for example, in the Paytrail for WHMCS module created by Net9 Oy.

We don't support this approach as it will become hard to keep track of the payment methods when they can enabled/disabled in multiple places. We also regularly roll-out new payment methods, so keeping the list updated is also cumbersome.
If you have multiple stores, we suggest you use multiple Merchant IDs, one for each store, so you can then manage the payment methods per store in the Paytrail Admin Panel.
If you are interested on this approach, do not hesitate to contact our Customer Service at asiakaspalvelu@paytrail.com

repo: paytrail/paytrail-for-woocommerce


text:
Added capability to specify hash functions for manifest

Added tests for specifying hashes.
Fixed bug with test/models/test_mitgcm.py that globally changed
config. Now specify config to write and make deep copies where
appropriate.
Changed common input in tests to make local import.
Fixes #233

Hello @aidanheerdegen! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

In the file payu/manifest.py:

Line 35:29: W291 trailing whitespace
Line 36:30: W291 trailing whitespace
Line 37:42: W291 trailing whitespace
Line 38:42: W291 trailing whitespace
Line 41:54: W291 trailing whitespace
Line 42:75: W291 trailing whitespace
Line 415:68: W291 trailing whitespace
Line 416:68: W291 trailing whitespace
Line 417:80: E501 line too long (92 > 79 characters)

In the file test/common.py:

Line 146:67: E231 missing whitespace after ','

In the file test/test_manifest.py:

Line 503:1: E302 expected 2 blank lines, found 1
Line 521:19: E201 whitespace after '('
Line 521:27: E225 missing whitespace around operator
Line 543:19: E201 whitespace after '('
Line 543:27: E225 missing whitespace around operator
Line 566:1: W391 blank line at end of file

repo: payu-org/payu


text:
Couldn't load latest version properly giving SSLError

https://github.com/pbcquoc/vietocr/issues/79#issuecomment-1336027208
I am facing SSLERROR in my local system  while running the code
It's not able to access the base.yml file

https://github.com/pbcquoc/vietocr/issues/79#issuecomment-1336974208

try to run your code on colab to see whether it shows the error or not?since i can't replicate your bug on my side.

In colab I can able- to import the config but getting this error while initiating the Trainer

I solved the SSLERROR
I think there are lots of bugs in code in different environments its giving different errors
I ran the code in my local system  and I am getting this error why I trying to train it

update to the lastest version vocr==0.3.11

Tried with latest version

Hi
Again the SSL Error is coming previously I opened the vscode with administration access and it worked but now with Administration access also its showing the SSL Error
I installed the latest version only

try to run this code in Linux

repo: pbcquoc/vietocr


text:
Update keycloak-adapter-core, ... to 23.0.1

About this PR
📦 Updates

org.keycloak:keycloak-adapter-core
org.keycloak:keycloak-admin-client
org.keycloak:keycloak-core

from 21.1.2 to 23.0.1 ⚠
Usage
✅ Please merge!
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

⚙ Adjust future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "org.keycloak" } ]

Or, add this to slow down future updates of this dependency:
dependencyOverrides = [{
  pullRequests = { frequency = "30 days" },
  dependency = { groupId = "org.keycloak" }
}]

labels: library-update, early-semver-major, semver-spec-major, commit-count:1

Superseded by #785.


text:
🛑 KA is down

In 80323e1, KA (https://kiena.vn) was down:

HTTP code: 0
Response time: 0 ms

Resolved: KA is back up in 62678e2 after 15 minutes.

repo: pcsvn/upptime


text:
DS3622xs+ Support?

Does this package support the DS3622xs+? I'm following the instructions to use the physical GPU and when I try to run nvidia-smi, I get the following error.
/volume1/@appstore/NVIDIARuntimeLibrary/usr/bin# ./nvidia-smi
NVIDIA-SMI couldn't find libnvidia-ml.so library in your system. Please make sure that the NVIDIA Display Driver is properly installed and present in your system.
Please also try adding directory that contains libnvidia-ml.so to your system PATH.
Perhaps there are some path issues on this platform?

您好，您的邮件已收到，我尽快回复您！

Seems that I missed a step and am making some progress now.

DS_AAAA_XS+ series not supported now.

DS3622xs+ 7.1+ 版本的虚拟群晖求支持

authors: cclarke99 ctaoist pdbear


text:
Fix to allow zero values for form fields

Fixes #366
I can't see any negative impact of this change.
It's still technically possible to break a schema by forcibly deleting a required value and ignoring the red form error message, but it's a lot better than having the value removed from the schema entirely if it's value is 0.
You can still remove values such as rotation from the schema, but by deleting the values not by setting them as 0. If we wanted to do this we would need to check if these fields are optional or not then remove them. This is more complex to implement.
https://github.com/pdfme/pdfme/assets/7068515/b3350f0c-111d-48ec-8c1a-5a100d4ee4ba

Hey @peteward ,
I checked.
I added this code a few weeks ago to solve this problem.
https://github.com/pdfme/pdfme/blob/main/packages/ui/src/components/Designer/Sidebar/DetailView/index.tsx#L80
However, with this PR,  the problem seems to have reoccurred.
https://github.com/pdfme/pdfme/assets/24843808/decefe70-249a-4578-9e3a-b7d988b0637b
https://github.com/pdfme/pdfme/issues/366#issuecomment-1856185506
You are right.  My last bug fix is not perfect.
While it's not the most elegant solution, hardcoding to assign undefined to the opacity and rotate values if they are null could be a feasible workaround. What do you think?

Ok, I've updated as you have suggested.
Longer-term this needs some thought. Ideally we should be able to use a definition to check and enforce an appropriate value. I tried pulling in the Zod definition but it was getting messy, and it only describes the core shared attributes of schema, not the individual ones.  I also tried getting the propPanel from the schema and trying to check if the field was required or not, but that wasn't easy and doesn't necessarily align to the problem we have here.
Also, it's still possible to get into a bad state because there's no enforcement of values:
https://github.com/pdfme/pdfme/assets/7068515/1bcc9a14-cd71-4aee-9c7b-8ee88162af4c
I think we do need to make the validation state of the template more easily available. At least that would help with the above issue.

Please ignore failing test.
also i create new issue about often fail CI.
https://github.com/pdfme/pdfme/issues/370

Good teamwork!!

I know! we are good team👍

authors: hand-dot peteward

repo: pdfme/pdfme


text:
🛑 Garage App API is down

In 0ef3fd7, Garage App API ($GARAGE_API_URL) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Garage App API is back up in 30b24ae after 9 minutes.

repo: pdroll/upptime


text:
How to change image watermark and text  postion in screen in OpenGlRtmp.java

How to change image watermark and text  postion in screen in OpenGlRtmp.java

To change watermark you have this methods:
https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/rtplibrary/src/main/java/com/pedro/rtplibrary/base/Camera1Base.java#L568
https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/rtplibrary/src/main/java/com/pedro/rtplibrary/base/Camera1Base.java#L583
This work for ImageStreamObject, GifStreamObject and TextStreamObject.
If you want change position of Android view filter you need create a Layout set your view in the layout and send layout to filter instead of only your view.
Example send Button in center of the screen.
In XML:
<RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/rl_to_send"
      >
    <Button
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="Text to send"
        android:layout_centerInParent="true"
        />
  </RelativeLayout>

In Java code send RelativeLayout:
AndroidViewFilterRender androidViewFilterRender = new AndroidViewFilterRender();
androidViewFilterRender.setView(findViewById(R.id.rl_to_send));
rtmpCamera1.setFilter(androidViewFilterRender);


text:
Remove material icons

In pubspec.yaml, you can remove the line:
uses-material-design: true
Because this package don't use material icons and avoids conflicts with apps that use unicons but not material icons

Thanks for the suggestion. This issue has been fixed here!

authors: deandreamatias pedrolemoz

repo: pedrolemoz/unicons-flutter


text:
🛑 API MERCADO PUBLICO is down

In bea5454, API MERCADO PUBLICO (https://api.mercadopublico.cl/servicios/v1/publico/ordenesdecompra.json?fecha=30122022&CodigoOrganismo=7312&ticket=E1951384-BF88-4EE5-8C33-934680281626) was down:

HTTP code: 500
Response time: 621 ms

Resolved: API MERCADO PUBLICO is back up in 8820830.


text:
🛑 Beyond.pl is down

In c39fbe5, Beyond.pl (http://www.beyond.pl) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Beyond.pl is back up in a952cc5.

repo: pejotes/upptime


text:
🛑 Beyond.pl is down

In 0ff2b43, Beyond.pl (http://www.beyond.pl) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Beyond.pl is back up in eeaf55a.


text:
Pelias installation service

I would like to know if anyone could provide a full world pelias installation service. If any please contact me at damian@timersys.com

For the record, anyone looking for paid support setting up Pelias can talk to us over at Geocode Earth. Feel free to shoot us an email

authors: orangejulius timersys

repo: pelias/documentation


text:
🛑 Kecamatan Mustika Jaya is down

In c14fd01, Kecamatan Mustika Jaya (https://kec-mustikajaya.bekasikota.go.id) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Kecamatan Mustika Jaya is back up in 68d2f33.

repo: pemkotbekasi/website-status


text:
🛑 Badan Penanggulangan Bencana Daerah is down

In 222d7dc, Badan Penanggulangan Bencana Daerah (https://bpbd.bekasikota.go.id) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Badan Penanggulangan Bencana Daerah is back up in 31db2b7.


text:
🛑 Dinas Pengendalian Penduduk dan Keluarga Berencana is down

In df97507, Dinas Pengendalian Penduduk dan Keluarga Berencana (https://dppkb.bekasikota.go.id) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Dinas Pengendalian Penduduk dan Keluarga Berencana is back up in de0a798.


text:
Fix .schema

Add tests for .schema
Make command line sql arguments to allow .commands
Fix #192

@benclmnt Sorry, my cleanup PR caused a trivial merge conflict. Can you pleas rebase?

authors: benclmnt penberg

repo: penberg/limbo


text:
Add license to project

@StephPeets what kind of license?

MIT License probs

Great, done!

authors: StephPeets pendingupdate

repo: pendingupdate/github-projects


text:
[bug] Unable to undefine a keyboard shortcut

Hello,
Thank you for adding the customization options for the key bindings.
I would like to customize some key bindings to be "nothing". If I leave them blank, I see these errors

Is there a right way for unbinding the shortcuts?

Sure, I will fix this soon. Thanks for your suggestion!


text:
[SP-6241] - Backport of PDI-19627 - Add a checksum：When "Compatibility Mode" is checked and "Type" set to SHA-256, transformation errors out. (9.3 Suite)

@smmribeiro
@bcostahitachivantara
@renato-s

:white_check_mark: Build finished in 9m 7s
Build command:
mvn clean verify -B -e -Daudit -amd -pl plugins/core/impl

:exclamation: No tests found!
:information_source:  This is an automatic message

repo: pentaho/pentaho-kettle


text:
Create tooling for shielded genesis

Augment the operationally-focused (setting up nodes, etc) tooling from #17 with tooling for creating genesis files compatible with shielded transactions.  Genesis only happens once (even if that once happens many times during development), so it seems preferable not to have a special genesis input type for transactions, and instead have a way to have an initial state with shielded notes.
This should happen only after nailing down details and getting transaction functionality implemented with transparent proofs.

There's partial work on this in #112.
The remaining work to do is:

[ ] Specify address encodings (#63)
[ ] Add a create-genesis subcommand to pd (rationale: it's chain setup, so better keep it isolated from pcli) that:

[ ] takes as input:

a chain id
a list of (amount, asset name, destination address) tuples (maybe using structopt's Vec magic?)

[ ] hashes the chain id and uses it as the seed for a ChaCha20 RNG;
[ ] uses the deterministic RNG to create the blinding factors and notes for the input tuples;
[ ] writes the pretty-printed JSON to standard out.

at this point, it can be copy-pasted to whereever, and it's fully deterministically generated.

repo: penumbra-zone/penumbra


text:
[wasm] wasm crate should provide useful types

the wasm crate should produce an npm package that exports useful types.
the wasm crate build currently emits a useless declaration asserting everything is "any" type.
the completely separate wasm-ts wrapper package in the web repo is essentially a shim that reintroduces type information. requiring manual type annotation by a separate wrapper package is incorrect.
type declarations should be colocated with the implementation, even if that requires additional tooling or manual annotation inside the rust code.

https://dawchihliou.github.io/articles/share-rust-types-with-typescript-for-webassembly-in-30-seconds

i've spoken to @grod220 about tsify, but iirc they suggested it was unsuitable for some reason. would be interesting to get some detail on what blocks tsify, vs what might block ts-rs (seems to have serde integration but no wasm bindgen integration) or wasm bindgen's typescript_type and typescript_custom_section

This is a very worthwhile thing to explore again. The first attempt in going through this, it became simply easier to do type annotation+validation in wrappers given we need to associate the any's with the automatically generated BufBuild types. But it’s sad we cannot simply inherit all of the correct types (somehow).

Tsify

The best rust-side solution that exists. However, all fields (recursively) must have those Rust attributes. For example, take WasmPlanner. We could not give it the tsify annotations given Serialize/Deserialize is not given to the external IdbDatabase type. This unfortunately is the case with many of these crypto libraries we are using. I ran into this blocker so many times, kinda gave up.
For things that are internal to the wasm crate (like IndexedDbConstants), this library seems like a great candidate to use.
They cannot derive types for the protobuf-rust generated types. But even if they could, I wonder how they'd compare to (or if they'd compete with) the typescript types generated directly from the protobufs 🤔. When deserialized into those, they get a bunch of utility methods too.

ts-rs

Have not tried this

wasm bindgen's string type defs

I considered this not a good option given we already have BufBuild's automatically generated typescript types. Re-typing those manually into the Rust string would drive someone to madness. Further, it wouldn't stay in sync and have to constantly be updated manually.
It doesn't do validation. In the web wasm package, we use Zod to do some minimal type validations in tests & at runtime.

Completely random thought, but what if we defined the wasm crate functions as implementing a grpc service (aka make protobuf definitions)? Then perhaps we could inherit bufbuild type annotations to calls to this service.
This would solve issues with types needing to stay updated (given they would share definitions between the other penumbra protos) and we retain the benefit of all of the BufBuild automatic type/class generation.
The only tricky thing would be writing the transport package that would route a request to a wasm function.

keeping wasm crate exports as close as possible to existing types, such as buf request/response types or service/method impl types, is the goal.
i understand it is frustrating to annotate types in the rust code that essentially duplicate a type that exists outside of the rust code, but it is worse to annotate nothing in the rust code, and then annotate types in a wrapper package that essentially duplicate etc etc
is it possible to use typescript_type independently of typescript_custom_section, or use typescript_custom_section to simply import { ExistingX } from '...'; or define a export type WasmX = ExistingX;?
and again, i assert serde wasm bindgen is capable of handling and emitting real javascript objects, not just simple json, so we should be able to use buf's constructors. at worst, if that really is impossible, we could emit json with @type annotation and then use buf tooling for reflection.
transport package is already routing to impls in the extension. complying with impl types will only simplify that.

authors: TalDerei grod220 turbocrime


text:
Allow recomposition/restyling of existing components

Added css prop to components that allows pass-through of styles to be able to override styles of a component, should it need it
Added an HoC to give an example of how to override the component, not intended for export
Added a test for the HoC to make sure it does what it's supposed to
Fixed a couple of issues

null where should have been undefined
textarea was consuming all props, instead of just input props

Usage of the change would be as follows:
import BackLink from '@govuk-react/back-link';
const NewBackLink  = glamorous(BackLink)({
  backgroundColor: "blue",
  color: "white",
});

See glamorous website "Overriding component styles" section (however it doesn't clearly explain the method, so i wrote one based on KCD's tweet to me)

We need to be careful about this:

what styles would be ok to live on the same element?
are there occasions having additional styles on a wrapping element would suffice?
if we want to support particular overrides such as background colour or text colour, could these be props that are passed in?

There are a lot of things that could get messy by allowing anything to be overridden.
The nice thing about BEM > CSS Modules > CSS in JS is that it's predictable and styles are self contained.
This makes the styles that are applied to an element unpredictable.
e.g. this element looks incorrect, which CSS is to blame? What needs changing?
e.g. a component gets updated and breaks components that are using it by applying CSS to the same element
e.g. a component uses color for text, which is overridden elsewhere, but then a code update puts the text in a :before{content: and the overriding CSS no longer works. But the ability to change the colour was never a documented feature of the component... so is this ok?

yeah agreed, but my reasoning was to have the ability recompose a component if needs be, rather than disallow.. but yeah up for a discussion

authors: marksy penx

repo: penx/govuk-react


text:
Where is "Joystick.h"

I try This lib, But it doesn't work：
arduino-JOYSTICK

https://github.com/MHeironimus/ArduinoJoystickLibrary
Is't this?

Yes the latter one looks like the correct one. I'm away from home at the moment, but if that works for you, I'd wlecome a PR to update the readme to mention this.

Yes. I tested the latter one,It’s working!
Thanks for your reply! I will close this issue!

authors: pepijndevos vgegok

repo: pepijndevos/spacefox


text:
Error during deployment: response doesn't contain SecurityGroups.0.GroupName

Currently we are not able to deploy the Stack. Did not face this problem before.
Deployment error:
CustomResource attribute error: Vendor response doesn't contain SecurityGroups.0.GroupName key in object arn:aws:cloudformation:***:stack/GitlabRunnerStack/***RunnerRunnersSecurityGroupDescribeSGCustomResource*** in S3 bucket cloudformation-custom-resource-storage-***

We use the latest versions of AWS CDK and @pepperize packages:
"aws-cdk": "^2.73.0",
"aws-cdk-lib": "^2.73.0",

"@pepperize/cdk-autoscaling-gitlab-runner": "^0.2.456",
"@pepperize/cdk-private-bucket": "^0.0.360",
"@pepperize/cdk-security-group": "^0.0.433",
"@pepperize/cdk-vpc": "^0.0.575",

The logs of the Lambda which runs the describeSecurityGroups command look like this. Looks like the response data object is empty to me.
{
    "Status": "SUCCESS",
    "Reason": "OK",
    "PhysicalResourceId": "sg-***",
    "StackId": "arn:aws:cloudformation:e***:stack/GitlabRunnerStack/***",
    "RequestId": "***",
    "LogicalResourceId": "RunnerRunnersSecurityGroupDescribeSGCustomResource***",
    "NoEcho": false,
    "Data": {}
}

I found out that the mentioned Lambda is executed with "RequestType": "Update". Because the custom resource in the pepperize/cdk-security-group package is configured to only run on request type Create the Lambda runs without any API call and the response is empty ("Data": {}).
As there is no change on the SecurtyGroup I wonder a bit about the type Update. Maybe thats because the property InstallLatestAwsSdk for the custom resource changes to false as I can see comparing the CF templates.
"RunnerRunnersSecurityGroupDescribeSGCustomResource***": {
  "Type": "Custom::AWS",
  "Properties": {
    "ServiceToken": {
      "Fn::GetAtt": ["AWS***", "Arn"]
    },
    "Create": {
      "Fn::Join": [
        "",
        [
          "{\"service\":\"EC2\",\"action\":\"describeSecurityGroups\",\"parameters\":{\"GroupIds\":[\"",
          {
            "Fn::GetAtt": ["RunnerRunnersSecurityGroup***", "GroupId"]
          },
          "\"]},\"physicalResourceId\":{\"id\":\"",
          {
            "Fn::GetAtt": ["RunnerRunnersSecurityGroup***", "GroupId"]
          },
          "\"}}"
        ]
      ]
    },
    "InstallLatestAwsSdk": false
  },

@marco-streng TY 🚀

authors: marco-streng pflorek

repo: pepperize/cdk-autoscaling-gitlab-runner


text:
Instance Template: Service Accounts also register as needing change

Fixes #157

Works for me, no more diff for service account changing.

repo: perfectsense/gyro-google-provider


text:
Update deps

Update all dependencies (most are at least 2 years old).

I'll gladly merge this as soon as the macos tests pass.

How can I test on macos, without such a machine?

With a freshly compiled darling (github.com/darlinghq/darling), it passes:
Darling [/Volumes/SystemRoot/tmp]$ ./search.test -test.run=Alloc -test.v
=== RUN   TestGetPermanodeLocationAllocs
    handler_test.go:1020: explicit location from attrs: 0 allocations (max 0)
    handler_test.go:1020: referenced permanode location: 1 allocations (max 1)
    handler_test.go:1020: location from exif photo: 1 allocations (max 1)
--- PASS: TestGetPermanodeLocationAllocs (0.52s)
PASS

So, I don't know what happens in GitHub's test machine.

Maybe try disabling cache in the macos build? I've had similar issues in the past. We can remove cache from the macos workflow and never put it back...

How can I remove the cache?

By removing these lines:
https://github.com/perkeep/perkeep/blob/8171ea5b511bb969590f4439b8726b9e76c6499a/.github/workflows/tests-macos.yml#L18-L22

I know this sucks but the other option for debugging this quickly without access to macos would be to update ~50% of the libs and see if the build passes, then the other 50%.
You can test multiple setups in parallel by pushing to different branches and github will build them all in parallel.

This looks good to me @tgulacsi.
Are you done? I can merge whenever.

Yes, I am. Please merge it.

Done! thanks :))

authors: aviau tgulacsi

repo: perkeep/perkeep


text:
Misspell in Angle brackets？

https://docs.perl6.org/perl6.xhtml
Angle brackets <  > have displayed as &lt and &gt

Thanks. Fixed the &lt thing, but now noticing more code chunks double-escaped, like triple-escaped markup in code example in 29.2.7 Object Construction section.
The Pod::To::HTML thing needs a saner rewrite to fix all the issues.

Isn't this one rendered by Pod::To::Bigpage? Also related: #1825

Yeah, the rendering issues are now fixed. Unrelated to report in OP, there're a bunch of markup errors because of illegal IDs that start with a digit. Don't know if there's anything else, as the validation ends with "too many messages".

It's again these fake URLs due to HTML errors. I thought I had fixed some
of them...

It should be fixed by perl6/perl6-pod-to-bigpage@9fe402be403b64152bee04
I test it locally and do not know why it is not applied when generates.

I test it locally and do not know why it is not applied when generates.

Because module updates need to be installed on the server by the admins manually.

Ok, then it has been fixed.


text:
Perl 6 at a glance

In this issue I want to talk about the placement of a few things and also addition of new code samples. People should see the homepage and know what to expect of Perl 6.
I don't think there needs to an announcement panel(NEW: Perl 6 Rakudo Star ...). A download button should be enough. Unless I don't know the purpose of this announcement.
The most prominent part of the page is a general description for Perl 6 and a big logo. I think the list of features(with a bigger font) and the code samples are more important and should be shown there side by side.
I don't know what should be done with the other two, maybe a smaller logo in the header and a smaller description somewhere else.
And for the new additions, there are a few things that come to my mind that are not shown in samples:
CLI: I may seem to be exaggerating, but I think the MAIN sub is one of the greatest features of Perl 6. I don't think I'm alone in thinking that. It just makes it easy to write command line tools and small scripts. This may be a unique feature.
Object-oriented programming: It's not unique to Perl 6, but Perl 6 makes it easier. So maybe an example of a class with a role. Maybe even with some other features like parameterized role and the handles keyword, things like that.
Functional programming: For those interested in functional programming, a code sample shows what Perl 6 has to offer them. For example a mixture of map, grep, function composition and feed operator, metaoperators, hyeperoperators, ...
Optional Typing: Show types(for example in function parameters), subsets and where constraints.
What do you think? How do you think the homepage can be improved?

What do you think?

I think any topic such as visuals/layout/favourite features will have as many opinions as there are people willing to comment.
IMO instead of having a massive bikeshed about every minute detail we should create a Media Group consisting of 3-5 people whose responsibility would be to ensure our sites and other media offer consistent look and messaging.

How would we create such a group?

Ask who wants to volunteer for it and see if there are any takers.

OTOH that doesn't mean that that group can't extract ideas from people's opinions.

Yeah, they will be able to. The primary goal would be to avoid burning everyone out trying to decide what shade of grey the font should be. The Group can gather community feedback if they like, but they would be able to render their final decision whenever they feel they can.

And the Group doesn't have to consist of genius designers and web developers. The design/webdev work can be done by anyone, but the Group will be ensuring we stay focused on a consistent message and have a consistent look.

Hi there, I would like to help, count me in :)

Suggestions from initial post to add as examples - all the other items are covered in the linked ticket

[ ] CLI: I may seem to be exaggerating, but I think the MAIN sub is one of the greatest features of Perl 6. I don't think I'm alone in thinking that. It just makes it easy to write command line tools and small scripts. This may be a unique feature.
[ ] Object-oriented programming: It's not unique to Perl 6, but Perl 6 makes it easier. So maybe an example of a class with a role. Maybe even with some other features like parameterized role and the handles keyword, things like that.
[ ] Functional programming: For those interested in functional programming, a code sample shows what Perl 6 has to offer them. For example a mixture of map, grep, function composition and feed operator, metaoperators, hyeperoperators, ...
[ ] Optional Typing: Show types(for example in function parameters), subsets and where constraints.

authors: CIAvash chsanch coke zoffixznet


text:
Compilers: elaborate on NQP more?

the NQP section doesn't even mention that rakudo's written in it; that could be quite enlightening

fixed via ed8ca15

authors: softmoth timo


text:
ZMQStreamer needs kill signal

Under some scenarios, ZMQStreamers are left hanging (KeyboardInterrupt, Keras' epochs, etc). We'll need some machinery to kill the backgrounded process to not block execution.

Do you have a solution in mind? Some underbaked thoughts from googling a bit:

Explicitly catch errors in the receiver, close the context, and then re-raise?

http://zguide.zeromq.org/py:interrupt

Use a poller to unblock the receiver?

(http://stackoverflow.com/questions/17174001/stop-pyzmq-receiver-by-keyboardinterrupt)

Or, maybe provide a signal callback or list of possible exceptions to ZMQStreamer?

(same S.O. as previous, but the runner up responses)

I think we actually have this already in the finally clause of the ZMQStreamer.  But for whatever reason, it doesn't work properly.  I'll investigate.

Confirmed: ZMQStreamer is behaving correctly, it's just that the example that caused hanging was not using the timeout parameter.
We should set a non-zero default timeout going forward.  Since this only affects the waiting time on cleanup at the end of streaming, it shouldn't affect the sequence of data produced by the streamer, and therefore doesn't violate backwards compatibility.

authors: bmcfee cjacoby ejhumphrey

repo: pescadores/pescador

license: ISC


text:
{{action "something"}} gets converted to {{action this.something}}

Input:

  Test Link

Actual Result

  Test Link

Expected Result:

  Test Link

@GoygovRustam , I added a test for this case and it passes, so I think this needs more investigation.

https://github.com/pete-the-pete/ember-on-fn-codemod/commit/bca7f3b35f0cd9a290108e1cfdb03a7740cfd0f9

authors: GoygovRustam pete-the-pete

repo: pete-the-pete/ember-on-fn-codemod


text:
optional timeout parameter for the dd exec

rake spec successful, new test included. This is needed in AWS EC2 instances with more memory than disk I/O bandwidth. The exec can run into a timeout in some cases.
swap_file::files
  default parameters
    should compile into a catalogue without dependency cycles
    should contain Exec[Create swap file /mnt/swap.1] with command => "/bin/dd if=/dev/zero of=/mnt/swap.1 bs=1M count=1073" and creates => "/mnt/swap.1"
    should contain File[/mnt/swap.1] with owner => "root", group => "root", mode => "0600" and require => "Exec[Create swap file /mnt/swap.1]"
    should contain Exec[Attach swap file /mnt/swap.1] with command => "/sbin/mkswap /mnt/swap.1 && /sbin/swapon /mnt/swap.1", require => "File[/mnt/swap.1]" and unless => "/sbin/swapon -s | grep /mnt/swap.1"
    should contain Mount[/mnt/swap.1] with require => "Exec[Attach swap file /mnt/swap.1]"
  custom swapfilesize parameter
    should compile into a catalogue without dependency cycles
    should contain Exec[Create swap file /mnt/swap.1] with command => "/bin/dd if=/dev/zero of=/mnt/swap.1 bs=1M count=4402" and creates => "/mnt/swap.1"
  custom swapfilesize parameter with timeout
    should compile into a catalogue without dependency cycles
    should contain Exec[Create swap file /mnt/swap.2] with command => "/bin/dd if=/dev/zero of=/mnt/swap.2 bs=1M count=4402" and creates => "/mnt/swap.2"

Finished in 1.37 seconds (files took 1.06 seconds to load)
9 examples, 0 failures

@BIAndrews Very nice about the fallocate btw, I mean to do something about that was thinking about truncate, but according to this fallocate is the best so that's great :+1:  http://hasis053341.blogspot.co.uk/2014/08/using-fallocate-instead-of-dd-for.html

Ok after this PR I'll send another with the fallocate cmd option. I have it done already and the spec setup with a test all ready to go for you.

Rebased into https://github.com/petems/puppet-swap_file/pull/27

authors: BIAndrews petems


text:
this project need update

Hello i wonder if we can connect to who made this project and ask for update or also we try to update it together .  i would like to support this project . but i dont know much about programming so will need guide . it is really nice project
is it possible to update it or the team who make it did drooped it from their plans?

It could be forked.
Much of the code is on google drive as binary however, so one'd have to salvage that first

repo: peterljq/OpenMMD


text:
Possibilty to accept Generator function instead of static Arrays

es6-promise-pool [1] is similar to Bluebird's  map() function but it is much more
powerful in that the array must not be static.
If can be a generator function which may theoretically spit out an infinite number of promises.
As far as I can see, this cannot be realized with Bluebird currently or am I overlooking something.
[1] https://github.com/timdp/es6-promise-pool#generator

Accepting ES2015 iterables is in Bluebird 3.0
Thanks for the suggestion.

authors: benjamingr vanthome

repo: petkaantonov/bluebird


text:
1and1 - "no job type" for all jobs instead of remote/ hybrid

ENVIROMENT: production
URL: https://scrapers.peviitor.ro/src/1and1/index.html
Browser: Chrome
Device: laptop
OS: Windows 10
STEPS TO REPRODUCE:

Open URL in browser
Type the name of the company in the search bar
Check job type

EXPECTED RESULTS:
Job type is remote/hybrid according to https://www.1and1.ro/careers
ACTUAL RESULTS:
"no job type"  appear

Fixed!

looks ok now!


text:
”Matei” is listed in the drop-down menu

Description:
"Matei" is listed in the drop-down menu alongside its corresponding county and commune, according to the law.
Precondition:
The website is up an running.

Step 1
Type "Matei" in the search bar.

Expected results
The location is listed in the drop-down menu as "Matei, Bistrița-Năsăud".


text:
”Telciu” is listed in the drop-down menu

Description:
"Telciu" is listed in the drop-down menu alongside its corresponding county and commune, according to the law.
Precondition:
The website is up an running.

Step 1
Type "Telciu" in the search bar.

Expected results
The location is listed in the drop-down menu as "Telciu, Bistrița-Năsăud".


text:
”Ciclova Română” is listed in the drop-down menu

Description:
"Ciclova Română" is listed in the drop-down menu alongside its corresponding county and commune, according to the law.
Precondition:
The website is up an running.

Step 1
Type "Ciclova Română" in the search bar.

Expected results
The location is listed in the drop-down menu as "Ciclova Română, Caraș-Severin".


text:
”Coronini”, ”Sfânta Elena” are listed in the drop-down menu

Description:
When user writes ”Coronini”, ”Sfânta Elena” the locations appear in the drop-down menu next to the comune and the county witch is a part according to the law.
Precondition:
The website is up an running.

Step 1
Write in the search bar "Coronini"

Expected results
The location appears in the drop-down menu as "Coronini, Caraș-Severin(Coronini)".

Step 2
Press "x" button.

Expected results
The location was deleted from the search bar.

Step 1
Write in the search bar "Sfânta Elena"

Expected results
The location appears in the drop-down menu as "Sfânta Elena, Caraș-Severin(Coronini)".


text:
”Densuș”, ”Criva”, ”Hățăgel”, ”Peșteana” are listed in the drop-down menu

Description:
When user writes ”Densuș”, ”Criva”, ”Hățăgel”, ”Peșteana” the locations appear in the drop-down menu next to the comune and the county which is a part according to the law.
Precondition:
The website is up an running.

Step 2
Press "x" button.

Expected results
The location was deleted from the search bar.

Step 3
Write in the search bar "Criva"

Expected results
The location appears in the drop-down menu as "Sat Criva, HUNEDOARA (Densuș)".

Step 4
Press "x" button.

Expected results
The location was deleted from the search bar.

Step 6
Press "x" button.

Expected results
The location was deleted from the search bar.

Step 7
Write in the search bar "Peșteana"

Expected results
The location appears in the drop-down menu as "Sat Peșteana, HUNEDOARA (Densuș)".


text:
"Gura Vitioarei" is listed in the drop-down menu

Description:
"Gura Vitioarei" is listed in the drop-down menu alongside its corresponding county according to the law
Precondition:
The website is up an running.

Step 1
Type "Gura Vitioarei" in the search bar.

Expected results
The location is listed in the drop-down menu as "Comuna Gura Vitioarei, PRAHOVA".


text:
Fix concat_hidden argument in GGNN

This PR solves issue #117.
I didn't write a test for this because I will need to modify many parts of existing test. But if I need, I will write a test.

Codecov Report

Merging #118 into master will not change coverage.
The diff coverage is 50%.

@@           Coverage Diff           @@
##           master     #118   +/-   ##
=======================================
  Coverage   73.27%   73.27%
=======================================
  Files          69       69
  Lines        2582     2582
=======================================
  Hits         1892     1892
  Misses        690      690

repo: pfnet-research/chainer-chemistry


text:
Status / Queues root queue bandwidth calculation fix. Issue #3381

[X] Redmine Issue: https://redmine.pfsense.org/issues/3381
[X] Ready for review

There is no need to do += for the root queue,
but only for child queues that are directly under the root queue
unused/outdated code is also deleted

Done

repo: pfsense/pfsense


text:
Add stderr back into protocol layer

The protocol layer currently redirects stderr to stdout.  This works but is not ideal.  To get $hError set the following is required:
$hError = gensym;
Then watch the fireworks and see if improvements can be made.

Implemented in ddd4c14.

repo: pgmasters/backrest


text:
Rename KeyAccessor to KeyGrip

This is consistent with GnuPG terminology.

Or is it?

repo: pgpainless/pgpainless


text:
哪里有中文文档？

哪里有中文文档？

---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28030091-?utm_campaign=plugin&utm_content=tracker%2F280146&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F280146&utm_medium=issues&utm_source=github).

Unfortunately we only offer support in english.

repo: phalcon/zephir


text:
Fix #1775

This PR generate tmp array and add to &EG(symbol_table).

@sergeyklay It's ok.

@dreamsxin Segmentation fault (core dumped) Travis for all PHP 7.x versions. Did you see

@sergeyklay Check

Thank you

authors: dreamsxin sergeyklay


text:
Partial Date Imputation derivations should only be done by derive_vars_dt/dtm functions

Feature Idea
Problem: We have some downstream functions which rely on a date input and we end up repeating the imputation arguments to allow for DTC inputs. There is a risk they may not always be consistently added, so that different functions could include different imputation arguments. It also makes maintenance challenging, as any change to the underlying imputation function impacts many places. You could argue that it’s not always so transparent as well, as imputations get hidden away in intermediary steps within a derivation function.
Agreed Solution: Only allow imputations to be done using the derive_date_vars.R functions (which would only accept DTC dates), and make users do this as a step before feeding in the DT/DTM variable into any downstream derivation function. This means all the downstream derivation functions that allow for DTC would now be updated to only use DT or DTM and to remove any arguments related to date imputation. The strategy should be explained in the date imputation vignette / admiral programming strategy.
As a result of this strategy, we will deprecate derive_vars_merged_dt() and derive_vars_merged_dtm().
Tasklist:

[ ]  remove date/time_imputation parameters from any derive_/_source functions except for derive_vars_dt & derive_vars_dtm, e.g. date_source or dthcaus_source (see #1125 - FYI @tamarasenior)
[ ]  remove mentions of DTC variables in any other derivation functions - they should only ever accept dates or datetimes, e.g. see derive_vars_last_dose details section
[ ]  update the date imputation vignette & programming strategy to clarify this approach
[ ]  deprecate derive_vars_merged_dt and derive_vars_merged_dtm
[ ]  update any such usages in templates & vignettes to match the approach given in the examples below

Relevant Input
See examples below
Relevant Output
See examples below
Reproducible Example/Pseudo Code
Examples:

For last known alive date (LSTALVDT), code that selects the date source could change as follows:

For first treatment date (TRTSDT), the call would change as follows:

@bms63 @thomas-neitmann @bundfussr - this is the first of the partial date refactor issues - please can you sanity check!

I assume "remove date/time_imputation parameters from any derive_/_source functions" means we remove these parameters but do not deprecate them.
@rossfarrugia , @thomas-neitmann , @bms63 , do you agree?

Personally i'm happy to just remove the arguments and accept the backward compatibility break given such a major change anyway, or otherwise will be a lot more work for you to try and update everywhere given the partial date re-factor connected update. @thomas-neitmann @bms63 feel free to over-rule me if a strong preference.

I would not want to follow our usual practice of first deprecating the arguments with a warning but still keeping the functionality working. Rather, I'd opt for keeping the arguments for the moment but using deprecate_stop() to issue an error and let users know what to do. If we just remove the arguments all together then people will get a cryptic error telling them that argument xyz does not exist but no advice on how to mitigate this issue.

Makes sense to me, too. So I'm going to use deprecate_stop().

authors: bundfussr rossfarrugia thomas-neitmann

repo: pharmaverse/admiral


text:
Feature Request: Implement consolidate_lookup_tables()

Feature Idea
Implement
consolidate_lookup_tables <- function(datasets,
                                      source_var = SOURCE,
                                      key_vars)

datasets expects a named list of dataset, e.g., datasets = list(company = global_adlb_params, study = adlb_params)
key_vars expects a list of variables, e.g., key_vars = vars(LBTESTCD, LBSPEC, LBMETHOD)

The function returns a dataset with one observation per key occurirng in any of the specified dataset. If a key occurs in more than one dataset, the observation from the last dataset is taken. The variable SOURCE should be added to the output dataset and set to the name of the dataset the observations is taken from.
Warnings should be issued if

The keys are not a unique key of any of the datasets.
The datasets contain different variables.

Relevant Input
No response
Relevant Output
No response
Reproducible Example/Pseudo Code
No response

@bundfussr i forget the background of this one, but do you think it should be tagged for next release? what's the purpose/impact?

@rossfarrugia , the background for this issue is that derive_vars_merged_lookup() expects a single lookup dataset. I.e., if you have  different sources, e.g., company parameter mappings and project parameter mappings, these need to be consolidated into a single dataset. This should be done by consolidate_lookup_tables().

authors: bundfussr rossfarrugia


text:
Linkedin is not validating

When I call the linkedInTrack method on events I get window error: lintrk is not defined

Old issue, you probably figured it out but just in case...
Did you use <LinkedInInsightTag /> somewhere in your code? (in your App or a layout)? If so, when loading your page, can you see loads from domain snap.licdn.com when looking at the network activity?

I close this issue. Please reopen it if you have any news about it.

authors: Rynebenson phbernard

repo: phbernard/nextjs-linkedIn-insight-tag


text:
[BUG]: Next.js SVG for typescript throws error

So I was copying and pasting a Next.js TSX component and adding it to my codebase, but it started giving me an error. Prettier failed to format the code.

The error came from the component name, which was named "next.js", causing the issue and removing the . fixes the issue

Hi Ansub! 😊
Thank you for letting us know! I will fix it shortly.

Fixed 🚀

Perfect, thanks!

authors: Ansub pheralb

repo: pheralb/svgl


text:
ParserModel not implemented yet (kind:180)

I'm defining a database middleware per the docs as follows:
// src/db/index.ts

/* eslint-disable no-var */
import { type Collection, MongoClient, type Db } from "mongodb";
import { env } from "env";
import type {
  PheroParams,
  PheroContext,
  PheroNextFunction,
} from "@phero/server";
import type { CatalogueItem } from "src/api/products/models";

var cachedClient: MongoClient;
var cachedDb: Db;

export type DbMiddlewareContext = {
  db: Db;
  client: MongoClient;
  collections: {
    products: Collection<CatalogueItem>;
  };
};

export async function databaseMiddleware(
  params: PheroParams, // not used in this middleware
  context: PheroContext, // not used in this middleware
  next: PheroNextFunction<DbMiddlewareContext> // we'll be adding `db` to the context, to be used later on
) {
  const client = cachedClient
    ? cachedClient
    : await MongoClient.connect(env.MONGODB_URI, { appName: "catty" });
  const db = cachedDb ? cachedDb : client.db(env.MONGODB_DB);

  cachedClient = client;
  cachedDb = db;

  await next({
    db,
    client,
    collections: {
      products: db.collection("products"),
    },
  });
}

I add it to my Phero File like so:
// src/phero.ts
import { createService } from "@phero/server";
import * as products from "src/api/products";
import { databaseMiddleware } from "src/db";

export const productService = createService(products, {
  middleware: [databaseMiddleware],
});

I use the exported DbMiddlewareContext type as the type of the first argument in functions which expect to follow this middleware, like so:
// src/api/createProduct.ts
import type { CatalogueItemInput } from "./models";
import type { DbMiddlewareContext } from "src/db";
import { ObjectId } from "mongodb";

export async function createProduct(
  context: DbMiddlewareContext,
  product: CatalogueItemInput
): Promise<CatalogueItemInput & { id: string }> {
  const { collections } = context;
  const { products } = collections;
  const withId = { _id: new ObjectId(), ...product };
  const result = await products.insertOne(withId);
  if (!result.acknowledged) throw "failed";
  return { ...product, id: withId._id.toHexString() };
}

For some reason, I get the following error:

src/db/index.ts:15:6 - error TS-PheroError:
S145: ParserModel not implemented yet: Db (kind:180)
15   db: Db;
If you think this is a bug, please submit an issue here: https://github.com/phero-hq/phero/issues

Have I found a bug or just a limitation / missing feature?

Your code seems great, let me get into it to figure out what’s going on 👍

Thanks! Forgot to mention I'm on version 0.9.13.
I was able to glean a bit more information by running npx phero server build, which gave me the following output with the error message:
node: <ref *6> NodeObject {
    pos: 362,
    end: 365,
    flags: 0,
    modifierFlagsCache: 0,
    transformFlags: 1,
    parent: <ref *3> NodeObject {
      pos: 356,
      end: 366,
      flags: 0,
      modifierFlagsCache: 536870912,
      transformFlags: 1,
      parent: <ref *1> NodeObject {
        pos: 354,
        end: 454,
        flags: 0,
        modifierFlagsCache: 0,
        transformFlags: 1,
        parent: <ref *2> NodeObject {
          pos: 319,
          end: 455,
          flags: 0,
          modifierFlagsCache: 536870913,
          transformFlags: 1,
          parent: SourceFileObject {
            pos: 0,
            end: 1059,
            flags: 2048,
            modifierFlagsCache: 0,
            transformFlags: 4195713,
            parent: undefined,
            kind: 308,
            statements: [Array],
            endOfFileToken: [TokenObject],
            fileName: '/Users/alec/dev/Catty/1/src/db/index.ts',
            text: '/* eslint-disable no-var */\n' +
              'import { type Collection, MongoClient, type Db } from "mongodb";\n' +
              'import { env } from "env";\n' +
              'import type {\n' +
              '  PheroParams,\n' +
              '  PheroContext,\n' +
              '  PheroNextFunction,\n' +
              '} from "@phero/server";\n' +
              'import type { CatalogueItem } from "@/api/products/models";\n' +
              '\n' +
              'var cachedClient: MongoClient;\n' +
              'var cachedDb: Db;\n' +
              '\n' +
              'export type DbMiddlewareContext = {\n' +
              '  db: Db;\n' +
              '  client: MongoClient;\n' +
              '  collections: {\n' +
              '    products: Collection<CatalogueItem>;\n' +
              '  };\n' +
              '};\n' +
              '\n' +
              'export async function databaseMiddleware(\n' +
              '  params: PheroParams, // not used in this middleware\n' +
              '  context: PheroContext, // not used in this middleware\n' +
              "  next: PheroNextFunction<DbMiddlewareContext> // we'll be adding `db` to the context, to be used later on\n" +
              ') {\n' +
              '  const client = cachedClient\n' +
              '    ? cachedClient\n' +
              '    : await MongoClient.connect(env.MONGODB_URI, { appName: "catty" });\n' +
              '  const db = cachedDb ? cachedDb : client.db(env.MONGODB_DB);\n' +
              '\n' +
              '  cachedClient = client;\n' +
              '  cachedDb = db;\n' +
              '\n' +
              '  await next({\n' +
              '    db,\n' +
              '    client,\n' +
              '    collections: {\n' +
              '      products: db.collection("products"),\n' +
              '    },\n' +
              '  });\n' +
              '}\n',
            languageVersion: 4,
            languageVariant: 0,
            scriptKind: 3,
            isDeclarationFile: false,
            hasNoDefaultLib: false,
            bindDiagnostics: [],
            bindSuggestionDiagnostics: undefined,
            externalModuleIndicator: [NodeObject],
            setExternalModuleIndicator: [Function: callback],
            pragmas: Map(0) {},
            checkJsDirective: undefined,
            referencedFiles: [],
            typeReferenceDirectives: [],
            libReferenceDirectives: [],
            amdDependencies: [],
            commentDirectives: undefined,
            nodeCount: 156,
            identifierCount: 59,
            identifiers: [Map],
            parseDiagnostics: [],
            path: '/users/alec/dev/catty/1/src/db/index.ts',
            resolvedPath: '/users/alec/dev/catty/1/src/db/index.ts',
            originalFileName: '/Users/alec/dev/Catty/1/src/db/index.ts',
            packageJsonLocations: undefined,
            packageJsonScope: undefined,
            imports: [Array],
            moduleAugmentations: [],
            ambientModuleNames: [],
            resolvedModules: [Object],
            symbol: [SymbolObject],
            locals: [Map],
            nextContainer: [NodeObject],
            endFlowNode: [Object],
            symbolCount: 34,
            classifiableNames: [Set],
            lineMap: [Array]
          },
          kind: 262,
          symbol: SymbolObject {
            flags: 524288,
            escapedName: 'DbMiddlewareContext',
            declarations: [Array],
            parent: [SymbolObject],
            isReferenced: 788968,
            id: 26
          },
          localSymbol: SymbolObject {
            flags: 0,
            escapedName: 'DbMiddlewareContext',
            declarations: [Array],
            parent: undefined,
            exportSymbol: [SymbolObject]
          },
          locals: Map(0) {},
          nextContainer: [Circular *1],
          name: IdentifierObject {
            pos: 332,
            end: 352,
            flags: 0,
            modifierFlagsCache: 0,
            transformFlags: 0,
            parent: [Circular *2],
            kind: 79,
            originalKeywordKind: undefined,
            escapedText: 'DbMiddlewareContext',
            flowNode: [Object]
          },
          modifiers: [
            [TokenObject],
            pos: 319,
            end: 327,
            hasTrailingComma: false,
            transformFlags: 0
          ],
          typeParameters: undefined,
          type: [Circular *1],
          illegalDecorators: undefined,
          id: 1320
        },
        kind: 184,
        members: [
          [Circular *3],
          NodeObject {
            pos: 366,
            end: 389,
            flags: 0,
            modifierFlagsCache: 536870912,
            transformFlags: 1,
            parent: [Circular *1],
            kind: 168,
            symbol: [SymbolObject],
            localSymbol: undefined,
            locals: undefined,
            nextContainer: undefined,
            name: [IdentifierObject],
            modifiers: undefined,
            type: [NodeObject],
            questionToken: undefined,
            initializer: undefined
          },
          NodeObject {
            pos: 389,
            end: 452,
            flags: 0,
            modifierFlagsCache: 536870912,
            transformFlags: 1,
            parent: [Circular *1],
            kind: 168,
            symbol: [SymbolObject],
            localSymbol: undefined,
            locals: undefined,
            nextContainer: undefined,
            name: [IdentifierObject],
            modifiers: undefined,
            type: [NodeObject],
            questionToken: undefined,
            initializer: undefined
          },
          pos: 356,
          end: 452,
          hasTrailingComma: false,
          transformFlags: 1
        ],
        symbol: SymbolObject {
          flags: 2048,
          escapedName: '__type',
          declarations: [ [Circular *1] ],
          members: Map(3) {
            'db' => [SymbolObject],
            'client' => [SymbolObject],
            'collections' => [SymbolObject]
          },
          id: 27
        },
        nextContainer: <ref *4> NodeObject {
          pos: 404,
          end: 451,
          flags: 0,
          modifierFlagsCache: 0,
          transformFlags: 1,
          parent: NodeObject {
            pos: 389,
            end: 452,
            flags: 0,
            modifierFlagsCache: 536870912,
            transformFlags: 1,
            parent: [Circular *1],
            kind: 168,
            symbol: [SymbolObject],
            localSymbol: undefined,
            locals: undefined,
            nextContainer: undefined,
            name: [IdentifierObject],
            modifiers: undefined,
            type: [Circular *4],
            questionToken: undefined,
            initializer: undefined
          },
          kind: 184,
          members: [
            [NodeObject],
            pos: 406,
            end: 447,
            hasTrailingComma: false,
            transformFlags: 1
          ],
          symbol: SymbolObject {
            flags: 2048,
            escapedName: '__type',
            declarations: [Array],
            members: [Map]
          }
        },
        id: 1319
      },
      kind: 168,
      symbol: <ref *5> SymbolObject {
        flags: 4,
        escapedName: 'db',
        declarations: [ [Circular *3] ],
        valueDeclaration: [Circular *3],
        parent: SymbolObject {
          flags: 2048,
          escapedName: '__type',
          declarations: [ [NodeObject] ],
          members: Map(3) {
            'db' => [Circular *5],
            'client' => [SymbolObject],
            'collections' => [SymbolObject]
          },
          id: 27
        }
      },
      localSymbol: undefined,
      locals: undefined,
      nextContainer: undefined,
      name: IdentifierObject {
        pos: 356,
        end: 361,
        flags: 0,
        modifierFlagsCache: 0,
        transformFlags: 0,
        parent: [Circular *3],
        kind: 79,
        originalKeywordKind: undefined,
        escapedText: 'db',
        flowNode: { flags: 2 }
      },
      modifiers: undefined,
      type: [Circular *6],
      questionToken: undefined,
      initializer: undefined
    },
    kind: 180,
    typeName: IdentifierObject {
      pos: 362,
      end: 365,
      flags: 0,
      modifierFlagsCache: 0,
      transformFlags: 0,
      parent: [Circular *6],
      kind: 79,
      originalKeywordKind: undefined,
      escapedText: 'Db',
      flowNode: { flags: 2 }
    },
    typeArguments: undefined,
    id: 1321
  }
}

Thanks for the extra information. The issue seems to have something to do with the fact that we’re validating (runtime) what data flows through all middleware and into your function, and we don’t support everything that is inside of the Mongo API.
I couldn’t get to a nice workaround immediately, but will get to that soon. Could you maybe expose the Mongo client from a singleton, instead of passing it along with middleware? I can see that your approach is how you’d want it, but that could be a workaround for now.

The reason this doesn't work is because we cannot generate the parsers used for runtime validation (yet?), like @Jpunt  said.
You can still use this setup with a workaround by setting the type of the client to unknown in the middleware. You'll have to cast it to the MongoClient and Db type inside your function tho, which is far from ideal but does the job:
// src/db/index.ts
import type {
  PheroParams,
  PheroContext,
  PheroNextFunction,
} from "@phero/server"
import type { CatalogueItem } from "src/api/products/models"

let cachedClient: MongoClient
let cachedDb: Db

export type DbMiddlewareContext = {
  db: unknown
  client: unknown
  collections: {
    products: Collection<CatalogueItem>
  }
}

export async function databaseMiddleware(
  params: PheroParams,
  context: PheroContext,
  next: PheroNextFunction<DbMiddlewareContext>,
) {
  const client = cachedClient
    ? cachedClient
    : await MongoClient.connect(env.MONGODB_URI, { appName: "catty" })
  const db = cachedDb ? cachedDb : client.db(env.MONGODB_DB)

  cachedClient = client
  cachedDb = db

  await next({
    db,
    client,
    collections: {
      products: db.collection("products"),
    },
  })
}

// src/api/createProduct.ts
import type { CatalogueItemInput } from "./models"
import type { DbMiddlewareContext } from "src/db"

export async function createProduct(
  context: DbMiddlewareContext,
  product: CatalogueItemInput,
): Promise<CatalogueItemInput & { id: string }> {
  const db = context.db as Db
  const client = context.client as MongoClient
}

Please note that I just tested this with a Prisma setup and not mongo, but it should be similar.

Thanks for the reply! Both of those work-arounds would be fine. I was
mostly kicking the tires, anyhow 😋
I imagine it's a tall order to implement parsers for every edge case... if
it's even possible, given the limits of static analysis.
I think I'd be quite content with an "escape hatch" that allows for opting
out of parsing for certain types - Perhaps a "no-phero" file where you can
drop no-parse type defs, or a NoPhero "magic" union type exported from the
phero-file (my brain keeps trying to spell it phero-phile 🙄).
On Sun, Feb 5, 2023, 06:26 Jim @.***> wrote:

The reason this doesn't work is because we cannot generate the parsers
used for runtime validation (yet?), like @Jpunt https://github.com/Jpunt
said.
You can still use this setup with a workaround by setting the type of the
client to unknown in the middleware. You'll have to cast it to the
MongoClient and Db type inside your function tho, which is far from ideal
but does the job:
// src/db/index.ts
import type {
PheroParams,
PheroContext,
PheroNextFunction,
} from @.***/server"
import type { CatalogueItem } from "src/api/products/models"
let cachedClient: MongoClient
let cachedDb: Db
export type DbMiddlewareContext = {
db: unknown
client: unknown
collections: {
products: Collection
}
}
export async function databaseMiddleware(
params: PheroParams,
context: PheroContext,
next: PheroNextFunction,
) {
const client = cachedClient
? cachedClient
: await MongoClient.connect(env.MONGODB_URI, { appName: "catty" })
const db = cachedDb ? cachedDb : client.db(env.MONGODB_DB)
cachedClient = client
cachedDb = db
await next({
db,
client,
collections: {
products: db.collection("products"),
},
})
}
// src/api/createProduct.ts
import type { CatalogueItemInput } from "./models"
import type { DbMiddlewareContext } from "src/db"
export async function createProduct(
context: DbMiddlewareContext,
product: CatalogueItemInput,
): Promise<CatalogueItemInput & { id: string }> {
const db = context.db as Db
const client = context.client as MongoClient
}
Please note that I just tested this with a Prisma setup and not mongo, but
it should be similar.
—
Reply to this email directly, view it on GitHub
https://github.com/phero-hq/phero/issues/100#issuecomment-1417688848,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/APZV5NIWG3PSGQCHN4TDOEDWV6L5PANCNFSM6AAAAAAUII6DRQ
.
You are receiving this because you were mentioned.Message ID:
@.***>

my brain keeps trying to spell it phero-phile 🙄

Yeah, we got that too 😅 Any suggestions? Phero-entry/declaration/code/?

3 & 1/2 months later... how about "Phero module" or "Phero spec" or "Phero def"? The latter is reminiscent of "Type def", which seems fitting for the nature of the lib.

authors: Jpunt helmturner jim-lub

repo: phero-hq/phero


text:
chore(main): release 4.3.0

:robot: I have created a release beep boop
4.3.0 (2024-02-12)
Features

deps: Bump cmake from 3.28.1 to 3.28.3 in /.devcontainer (#297) (41d0955)
deps: Bump gcovr from 6.0 to 7.0 in /.devcontainer (#279) (cdcf39b)
deps: Bump ubuntu from 6042500 to a2bbdf7 in /.devcontainer (#268) (48f20ac)
deps: Bump ubuntu from a2bbdf7 to e6173d4 in /.devcontainer (#270) (4453737)
deps: Bump ubuntu from e6173d4 to e9569c2 in /.devcontainer (#287) (41bf430)

This PR was generated with Release Please. See documentation.

:robot: Release is at https://github.com/philips-software/amp-devcontainer/releases/tag/v4.3.0 :sunflower:

repo: philips-software/amp-devcontainer


text:
Complete Parse Server

Hello, are all Parse Server features (Livequery, Local datastore, Query cache, cloud functions, etc..) implemented?

Hey
Not yet. It's a work in progress.
There's a lot to do in terms of queries. The project currently connects to
a Parse Server, can get and save objects and login. It's an updated version
of an old attempt I found. I'm currently working on this along side a
Flutter project I have but there's a few issues I'm hitting.
On Mon, 24 Sep 2018, 18:51 Alexander Melo, notifications@github.com wrote:

Hello, are all Parse Server features (Livequery, cloud functions, etc..)
implemented?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/phillwiggins/FlutterParseSDK/issues/2, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AHgn3tTSkKWo1tVxEDUGBzTnsCuwGq65ks5ueRurgaJpZM4W3JqK
.

Thank you.

authors: carnivash phillwiggins

repo: phillwiggins/FlutterParseSDK