Color picker

Follow-up on https://github.com/umbraco/Umbraco.UI/pull/112
Description
This PR add a Color Picker components splitted into smaller separate components. Furthermore it introduces a few utility functions like clamp.
// Clamp number between two values with the following line:
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);

An alternatively version of clamp function can be found here: https://www.webtips.dev/webtips/javascript/how-to-clamp-numbers-in-javascript
Types of changes

[x] New feature (non-breaking change which adds functionality)

Motivation and context

How to test?
Screenshots (if appropriate)
https://user-images.githubusercontent.com/2919859/183895436-d6d77811-d376-40e4-905b-9fe86976e592.mp4
Checklist

[ ] If my change requires a change to the documentation, I have updated the documentation in this pull request.
[x] I have read the CONTRIBUTING document.
[ ] I have added tests to cover my changes.

TODO

[ ] Make vertical slider go from min at bottom to max at top.
[ ] Update swatches with displayValue or label.
[x] Update handle position in color area when selecting color from palette.
[x] Ensure background color change in opacity slider. Maybe we need to separate into uui-color-hue-slider and uui-color-opacity to make the markup a bit different as the opacity slider need a layer for transparency and a layer with background color. These could eventually share a ColorSliderMixin.
[x] Can we configure color picker as inline vs. popup, e.g. using popover component if not inline?
[x] Support transparent colors in swatches, e.g. rendered with checkered background?
[ ] Deselect color in palette, when color is changed via color area or via hue slider.
[x] Focus handle inside color area and color sliders when navigating using keyboard.
[x] Close popover using esc key.
[x] Color is copied when clicking the preview button, but should this has any focus/animation like in the Shoelace library? Furthermore it seems the inner button element doesn't fill full height of uui-button which is seen with a transparent color on hover/focus.
[x] Can we use aria-label without a button text? It seems setting label on uui-button both set aria-label and button text. using button element instead.

@iOvergaard @nielslyngsoe @madsrasmussen I decided to go with the Colord library as it seems most flexible yet lightweight: https://colord.omgovich.ru/

Very good, @bjarnef !

@iOvergaard a bit more progress. In the uui-color-area I need to set color or hue value to update the spectrum as the hue value change.
<uui-color-area
          @change=${this.handleGridDrag}
          >
</uui-color-area>

Currently the color spectrum is generated based on this inside uui-color-area.
style=${styleMap({ backgroundColor: `hsl(${this.hue}deg, 100%, 50%)` })}

I tried something like this, but how would I get the updated value inside the uui-color-area as the hue/color change? Maybe using watch on the value property?
<uui-color-area
          .value=${live(this.value)}
          @change=${this.handleGridDrag}
          >
</uui-color-area>

@iOvergaard could you help a bit with my questions in https://github.com/umbraco/Umbraco.UI/pull/280#issuecomment-1210579049

Hi @bjarnef
Sorry, yes. If you want to react on the property called "value", you could do so by making a getter/setter like get value() and a set value(newVal) function, or you could react to changes in the lifecycle update or updated callbacks. Does that help you in any way?
If you want to return an object like colord you could do good by embedding it into an object that we control, so that if we ever switch colord with something else in the future, we won't have to change the entire event structure.

Okay, I did try something like that, but didn't quite get it to work. Maybe I missed something, so I will have another look.
Would you prefer the event return object with an instance of Colord or the specific properties like r, g, b etc.? Do you have a example of another component returning an object when an event occurs?

@bjarnef The combobox for instance returns a UUIComboboxEvent with a few string properties taken from an internal change event. There are other examples as well through out the library. I don't know exactly what properties are useful to have from colord but it sounds like a good approach to pull out details from their object, so that we can more easily swap it in the future if the need arises.

@iOvergaard it kinda works now, but not sure about the value property as when color is #fff hue will be 0.
https://user-images.githubusercontent.com/2919859/184881680-7dd3ddc4-8c07-4d50-b193-2ea9739e78ea.mp4
I don't think we want to change current hue value in this case, in this example the hue should still be 116.

Not sure what you mean exactly, @bjarnef. The Selectable mixin just listens to click events and then sends either a SELECTED or UNSELECTED event bubbling up through the stack so you'll need something high up in the stack to catch the events that will then forward the appropriate values down to the other components.

@iOvergaard I was looking at the example here:
https://github.com/umbraco/Umbraco.UI/blob/v1/dev/packages/uui-ref/lib/uui-ref.element.ts#L19-L21
Besides the styling of the selected attribute I am not sure where I get the value related to selected element. Furthermore can we control only at single element to be selected at the time? E.g. the color of the selected swatch. In the color picker we may not neccessary style the selected color swatch, but could be useful if it is used at icon picker in backoffice, if we want this part like it is today.

@bjarnef Uhh the value of the selected element. It's not included in the custom event, however you should be able to find it on the composed path if you are not listening to each color individually: https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath
Does that help you in any way? Otherwise I might be able to get someone else to help you next week ☺

@iOvergaard I had a look at the uui-combobox and uui-combobox-list components. From what I can see these are currently only single pickers? I guess it would make sense it these both support single/multi values.
We probably need something similar in color swatches. In Color Picker it would most likely be a single selection, but there may be other use-cases where multi selection makes sense.
https://user-images.githubusercontent.com/2919859/185665818-2e5ba1d7-9bb1-46f4-99b2-8fe6bd349f1e.mp4

https://github.com/umbraco/Umbraco.UI/pull/280/files/211f00a80d05433d0147c1a06190a2b2d52935a9..e206638269b17393138d0e2eabbc50ce520b3877 makes the convertion works from color names like, tomato, skyblue, lavendel etc.

@iOvergaard @nielslyngsoe I have updated this PR with a few things that needs to be done, but in general it's getting there 😎
It would be fantastic if some of you could try this out 🤞🙌

Hi @bjarnef
We are planning to review this very soon, and as you pointed out it would be useful in the new backoffice.

ColorArea
Default color seems to be white (or perhaps none), however the picker shows in the red area on load.
Preferably they should be the same/match from the beginning if possible
ColorPicker
The color sliders changes the width depends on the text of the color format button
The eyedropper button sometimes open previous windows tab (thus tabbing out of the browser)
Mouseover on the color preview shows a square when there is transparency (is this on purpose?)
Swatches
I miss some kind of indication for "this color is chosen". Forexample a checkmark on the chosen swatch color.
Idea: It could also be a setting you could turn on and off for the swatches if not everybody would want this..

@loivsen yes, the default color is empty, but it is difficult to select an empty color in the color area.
https://shoelace.style/components/color-picker
but maybe empty value should show transparent (checkered background) and no selection in color area like this current color picker in Umbraco: https://seballot.github.io/spectrum/
The format button should probably have a fixed or minimum width to ensure it doesn't change as format/text is changed (unless a monospaced font was used and same number of characters).
I haven't noticed the eyedropper open/changing window/tab, but it does allow to pick any color on screen - also outside browser window.
Regarding swatches the selected color currently has a selected attribute, so we could easily style this with a checkbox, but we need to update this it color later is changed to another color via input, sliders or color spectrum. In this case the (and if used next to icon picker as today) it would probably be a single picker, but if used later by package developer it might make sense to allow picking multiple colors.
Currently the swatches should only render if any swatches has been provided, so I guess it's a setting to disable the swatches, but it could be a separate setting.

Hi @bjarnef, is there anything we can assist you with from HQ's side?

@iOvergaard I noted a few things here https://github.com/umbraco/Umbraco.UI/pull/280#issue-1327540098 which would be great to look at.
I think we should consider if the active color swatches should be selected in color picker and configure the color swatches to allow single/multiple selections.
Furthermore as @loivsen mentioned https://github.com/umbraco/Umbraco.UI/pull/280#issuecomment-1250683770 when a transparent color is selected (the preview styling on uui-button looks a bit strange on focus).
We also need to change color in opacity slider as hue change, but I am not sure if the inner element in can be styled (e.g. via a property). Alternatively we may need to split these into two components (but it may be useful with a base ColorSlider mixin / component to inherit from, e.g. to get the basic functionality with min, max etc).
Maybe a empty color shouldn't show a selected color in the color area, but some color pickers tends to use "red" as default selection in the HSB-grid.

@iOvergaard I have merged with latest changes, but I now get some errors regarding import of the utils here:

@iOvergaard do you know what is cause the issue here? Furthermore I noticed there is no a v1/contrib branch... should I target the PR that branch instead?

Trying to look into it, @bjarnef. It's a bit odd. Seems like it doesn't register any of the new types unless explicitly building the uui-base package. But even then it complains.

You can continue targeting v1/dev here. We want to use v1/contrib moving forward for external pull requests.

@iOvergaard yes I could access e.g. demandCustomElement and Timer from uui-color-slider because these existed in node_modules folder here:
umbraco-ui\packages\uui-color-slider\node_modules\@umbraco-ui\uui-base\lib\utils

I figured it out, I think. There were some references to an older version of uui-base which resulted in the package being symlinked incorrectly.
I allowed myself to push to your branch - hope that's okay!

But clamp and math wasn't copied to this folder (I guess it failed before building/copying these).

Yeah, we are using npm workspaces here so it actually symlinks the folder ./node_modules/@umbraco-ui/uui-base to ./packages/uui-base but I guess it doesn't work well if you target another version than what uui-base currently claims to be (in this case 1.0.0-rc.3 --> 1.0.0).
Normally lerna will keep these up-to-date, but I guess since your library only exists in your fork, the lerna commands were never run in your copy when we released 1.0.0.

@iOvergaard yes, it seems to work after your change in https://github.com/umbraco/Umbraco.UI/commit/18097f1a58eb56338c1b5c31357c48ec83c3eeaf
I thought I tried that, but maybe something else failed at that time.

@iOvergaard one issue I have it when styling uui-button I get this on hover/focus:

Furthermore I have an inline mode using uui-popover, but it doesn't seem to work well with uui-color-picker inside it.
Sometimes it also "jumps" a bit to the correct position.
https://user-images.githubusercontent.com/2919859/195874809-95de1add-b57f-4a1a-a582-5123aae1a468.mp4

@iOvergaard I worked a bit more on this, so now color swatches accept transparency colors as well (the checkered style is currently used a few places, so maybe it could be added globally somewhere).

The color picker use the uui-popover, but unlike the docs here https://uui.umbraco.com/?path=/docs/uui-popover--aaa-overview  , I have moved the trigger outside the uui-popover element (otherwise the popover isn't closed when clicking the area to the right for trigger button).
I works great (although the popover seems to "jump" a bit to correct position) and when viewing in docs it opens behind the code sample.
Furthermore I am not sure how the hover on uui-button (I could adjust the padding inside overwriting a few variables though).
https://user-images.githubusercontent.com/2919859/195991778-da2416c9-ef73-4df2-8aa3-00da5ed47496.mp4

I also noticed uui-input had a method focus(), but not a blur() or select() like the Shoelace library had in their "input" component, e.g. when the preview color is clicked it select and copy the value from input field.

@iOvergaard @nielslyngsoe @madsrasmussen I think this is close to being ready to review, but there a few more todos I would like to finish: https://github.com/umbraco/Umbraco.UI/pull/280#issue-1327540098 and of course cleanup
But feel free to test it further, check naming convention, code style etc. 👍

@iOvergaard not sure if this is best practice, but it works: https://github.com/umbraco/Umbraco.UI/pull/280/commits/d62a56fd1dc4bddcb2055cda2b4bb3a692d448da
Could maybe be separated into two components for easier use.
https://user-images.githubusercontent.com/2919859/196813039-c315aa64-26d1-4f33-8234-a975a601674b.mp4

Hi @bjarnef
Looks good so far!
We've put in a review task for your PR in an upcoming sprint at the end of this month by @nielslyngsoe - hope that will be useful to you :-)

Hi @bjarnef
I finally have some time to look at this wonderful PR. Let me try to get around to everything though I properly will miss something.
First I have to say I love this, it seems to work very well and I think you have organized it well :-D
1. using the uui-button for the color-preview:
I'm not totally sure here, but I think it only makes sense to use the uui-button if its going to look like the other buttons.
In this case the color-picker-preview is sortof its own thing, so I think its would make sense to make it its own component and not extending the uui-button. Then these troubles should be gone.
**2. Display which color swatch is selected
To be consistent with the 'new' way we do this, I would recommend adding a blue border around the picked color-swatch.
See some of the Cards for reference. This one might need to have a black or dark-transparent 1px border on the inside in between the actual color and the select-border. For visual distinguishment. Note how this plays with the focus-outline.
3**. Styling the buttons next to the color-string input**
Again on the very detail-oriented side of visuals, it would be nice to display the buttons adjacent to the color-string-input in this way, so they get visual relation.

This I just made by removing the look from the buttons. Adding a border to the button group but not a left border.
Ensuring uui-buttons has --uui-button-height set to 100% and the second uui-button gets a left border.
(not on this screenshot, but it would also be great to make the text on the input-format-switcher go uppercase text-transform: uppercase
4. Sliders could be more minimalistic, to make a calm layout.
I would hide the display of the value and make the slider-bar just 6px heigh. To bring more focus to the picked color and make a more calm overall look:

BTW. great that the slider-handles are similar to the color-picker target, this gives a nice harmony!
5. Copying the color on click
Just a great detail, thanks!
6. There is a disconnection between color-swatches and the rest.
It goes both ways. If i pick a swatch and then start manipulating it, then the swatch should be de-selected.
And when I Pick a swatch the color-picker target is not updated.
Let me know if there is a concrete coding problem with this, then I would like to help out :-)
7. The color slider first rounds its value on pointer-up.
I think it's best to have the value rounded/corrected on pointer-move as the user then would get the same value while dragging as when releasing the cursor.  And I noticed currently the pointer-up logic only fires if the user releases the cursor on top of the handle. Maybe this would be fixed when implementing the onStop callback from drag. :-)
Okay, that was a lot, sorry if you get overwhelmed. Overall these are the final details. let me know if you like me to do some of the implementations.
Thanks in advance 💙

@nielslyngsoe I have fixed a few of the issues, but it seems I get some import errors after pulling latest changes into this branch,

The values at the sliders shouldn't be there, but it was mainly to output/debug the value and the rounded value.

Hi, @bjarnef sounds good, and sorry for the amount of feedback. I wanted to make sure you got everything :-)
Could you try running npm install  I think we might have an issue when new components come around, then you would need to re-install for the references to be updated. I'm thinking this could be the case as I cannot replicate the issue here. :-/
Let me know if that fixes it. I guess there is a potential for some NPM script improvements here.

It is fine :) I also had a lot of things I wanted to do and much of it has been solved.
I tried with npm install and I could run storybook, but it then seems to fail somewhere importing the other components. I think it is because they wasn't copied as node modules inside the package/component folder.
I think it was a similar issue which @iOvergaard looked at, but at that time it was a mismatch with package versions I think.

Hi @bjarnef
I updated the dependencies of the library, particularly there was an update on the main branch to the way rollup is used. I don't know if that is what you ran in to. It also seems you are using an older version of NPM seeing that the lockfile was quite old. Try and use Node 16 / NPM 8.15+, if you aren't already, and see if it works now with the latest updates.
I also fixed some inter-package dependencies we would have ran into, if we tried using the packages individually, namely dependencies between uui-color-swatches and uui-color-swatch 👍

BTW build is failing because of eslint issues.

Yeah, command says these versions of NodeJS and NPM, but pretty sure I updated these last time 😁

Yeah, command says these versions of NodeJS and NPM, but pretty sure I updated these last time 😁

Haha yes, the entire package-lock format changed between node 14 and 16, so try with that. Haven't tested with the latest LTS (node 18) yet, though, but that might also be worth a try.

@iOvergaard I upgraded NPM to v8 and NodeJS to v18.

However I get this error using NodeJS v18.12.1

@iOvergaard @nielslyngsoe I got it working again uninstalling NodeJS 18 and installing latest NodeJS 16.
Do we have any special animations in the UI library?
Currently I have this when copying the color from the preview button.
https://user-images.githubusercontent.com/2919859/203930978-84ac3310-d3b0-4306-845e-a6ee6cc3edb6.mp4

@nielslyngsoe regarding card selection / focus I noticed on click in looks like this.

but focus using keyboard it looks like this. Is that expected?

@iOvergaard I upgraded NPM to v8 and NodeJS to v18.

Yeah, I suspected as much. Expectedly some breaking changes have been introduced and we need to update all our products to node 16. We usually mark what is supported in the package.json:
https://github.com/umbraco/Umbraco.UI/blob/3dcb9ce2abd59dbb665ca0391aae9b72afa930f8/package.json#L53:L56

Hi @nielslyngsoe
I have modified this accordion to your suggestions:
1. using the uui-button for the color-preview

The preview button is a regular button element instead of using uui-button. it is similar button used as button (when not inline)

2. Display which color swatch is selected
It is using same styling as it could find in uui-card. I have changes to outline border to 1px though.
3**. Styling the buttons next to the color-string input**
I have styled a bit on the buttons here. I think we can't transforms text in uui-button directly without uppercase the actual text or in these case I wrapped the text in a nested span in the slot to transform text to uppercase.

Sliders could be more minimalistic, to make a calm layout.
I haven't changed this yet, but I think it would be great to still see the color spectrum and alpha gradient, so I didn't want to make the height too small and as it is also possible to click/touch the area, but 10px instead of the current 15px may be better?

5. Copying the color on click
I think the pulse animation should be moved somewhere to re-use. Not sure which color should be used here in the effect. It could use the current preview color, but not sure that would work with a very light color.
6. There is a disconnection between color-swatches and the rest.
I am not sure how to update this between the components. I could use a bit help with this :)
The uui-color-swatches has a change event, but not sure how we could update the selected state of the nested uui-swatch.
The swatches are currently a string array, but maybe it should also be an option with Array so each item e.g. both has color value and name/tooltip. E.g. if we intend to use swatches in other contexts with a name/label.
7. The color slider first rounds its value on pointer-up.
Currently it seems to work well, but I noticed a few cases where it seems to round the value to a different number from when I stopped dragging and releasing handle.
Furthermore I have also added the vertical attribute to uui-color-slider (in vertical mode it think we need to revert the min/max value, so low value it at bottom and high value is at top. I tried with CSS transform, but could make that work.
I also fixed where color/handle wasn't updated in uui-color-area which selecting a swatch color and initial color set from value property.
https://user-images.githubusercontent.com/2919859/204136935-2e728c0e-cd0b-4a5d-980d-2099d301e75d.mp4

Hi @bjarnef and happy new year!
I have synced your branch with v1/contrib and tried to clean-up a bit to make the build succeed (it was failing because of eslint rules). While I was at it, I did some more stuff to look into the last few bits to make it all come together:

I added support for actions in Storybook on most components
I moved the uui-color-* packages into a Color category in Storybook
I added the uui-color-* dependencies to the meta UUI package to enable the builder to catch and release them
I added a CHANGE event to uui-color-picker (seems like a good idea to know when a color has been picked?)
uui-color-slider: added support for ArrowUp and ArrowDown (especially useful on vertical=true)
Removed a few console logs and also a raw Value: ${value} on swatches

We have been using a custom build of uui-color-swatches and uui-color-swatch on the new backoffice for a while now, and they are looking good.
I want to see if I can get someone to review this very soon, so we can get it released. I'm thinking to do an RC of UUI 1.1.0 perhaps and include these new components then.

Hi @iOvergaard
Sounds great and happy new year to you as well 🎉
Regarding vertical color slider I also think we need a change to make it go from low value at bottom and high value at top.
Furthermore I guess we need to sync the colors so it isn't selected (unselected) in e.g. color swatches if changes elsewhere and the opposite if color is changed to a matching color in the swatches?

@bjarnef The vertical slider and value/label are listed as TODOs still in the description of this PR, right?
Regarding syncing of colors, I guess the uui-color-picker component should pick up the events from sub-components and update the others when it detects a change?

@iOvergaard yes here :)
https://github.com/umbraco/Umbraco.UI/pull/280#issue-1327540098
Yes, I guess that it is how it should work.
Currently the color swatches are based on string array of colors, but could it also accept Array where T contains label and value. E.g. if we want to show tooltip/label for each color swatch. Maybe we also want something similar to the advanced color swatches with labels in the current approved color picker in Umbraco. These could probably use the card component I guess?


V11 compatibility

foundry.js:753 TypeError: Failed drawing interface canvas group: this._getWallColor is not a function. this._getWallColor is not a function
[Detected 3 packages: df-architect, lib-wrapper, monks-tokenbar]
    at Wall._onWallDraw (WallDirections.ts:62:15)
    at 🎁call_wrapper [as call_wrapper] (libWrapper-wrapper.js:616:16)
    at 🎁Wall.prototype.draw#0 (libWrapper-wrapper.js:189:20)
    at foundry.js:34691:18
    at EmbeddedCollection.map (commons.js:4191:26)
    at WallsLayer._draw (foundry.js:34688:32)
    at WallsLayer._draw (foundry.js:42195:17)
    at WallsLayer.draw (foundry.js:34194:16)
    at async InterfaceCanvasGroup.draw (foundry.js:28972:9)
    at async InterfaceCanvasGroup.draw (foundry.js:47329:5)
    at async Canvas.draw (foundry.js:26135:9)
    at async Scene.view (foundry.js:23275:7)
    at async Scene.sceneView (monks-tokenbar.js:168:20)
    at async Game.initializeCanvas (foundry.js:8789:20)
    at async Game.setupGame (foundry.js:8623:5)
    at async Game._initializeGameView (foundry.js:9881:5)
    at async Game.initialize (foundry.js:8544:5)
onError @ foundry.js:753
🎁call_wrapped @ libWrapper-wrapper.js:507
🎁Hooks.onError#lib-wrapper @ listeners.js:138
🎁Hooks.onError#0 @ libWrapper-wrapper.js:187
draw @ foundry.js:26137
await in draw (async)
view @ foundry.js:23275
🎁call_wrapped @ libWrapper-wrapper.js:507
sceneView @ monks-tokenbar.js:168
🎁call_wrapper @ libWrapper-wrapper.js:616
🎁Scene.prototype.view#0 @ libWrapper-wrapper.js:189
initializeCanvas @ foundry.js:8789
await in initializeCanvas (async)
setupGame @ foundry.js:8618
await in setupGame (async)
_initializeGameView @ foundry.js:9881
_initializeView @ foundry.js:9857
initialize @ foundry.js:8544
await in initialize (async)
🎁call_wrapped @ libWrapper-wrapper.js:507
🎁libWrapperInit @ libWrapper-api.js:805
await in 🎁libWrapperInit (async)
🎁Game.prototype.initialize#0 @ libWrapper-wrapper.js:187
window.addEventListener.once @ foundry.js:90096
foundry.js:67285 Failed drawing interface canvas group: this._getWallColor is not a function

Wondering if this module is abandoned?

So it seems so to me.
Even more, looking at the discussions around the other open issues, I get the impression that migrating this module to v11 might be a tough nut. This mod overrides - by design -  some basic UI functionality of Foundry, and it appears that v11, by design, now prohibits such oversteering. At least in some of the aspects (whereas some of them might still work).
So someone would have to sort out what is still supported and what###  isn't, then at least remove all the now unsupported functions, update the docs, repackage the whole thing etc.

Think I will remain with 10 for the time being. DF's modules are far too good to skip.


Add porchctl command

This is a porchctl command that has the repo and rpkg commands from kpt alpha.


Allow kite creation with an existing transport/ws

This is crucial for creating a bi-directional connection between client/server. And would be used by rope.
This can be hooked into the KiteServer connection event.
We are emitting a Session object with connection event, and this occurs right after a server class receives a connection.
Since a low-level server class (e.g WebSocketServer and SockJsServer classes) will have a connection info attached to it and it's a similar object in which we are creating ourselves in Kite base class (this.ws = new WebSocket()) having a way to create a Kite object with an existing connection object would be really helpful here.

This is gonna be implemented in Kite base class, and it's gonna accept a connection via transport option.
If a transport option is present in the option, it's gonna immediately wrap the connection and it's gonna behave as it's connected.
This is gonna affect connect and onOpen functions.

onOpen is gonna be called immediately if a transport option is set to get things going.
connect is gonna be a noop.

autoReconnect option is gonna be redundant when a transport option is present, as we don't know how we are gonna connect back to a connection if we didn't create it.
url option will not gonna be used.

Let's say we have a KiteServer running on ws://localhost:9999:
import { KiteServer } from 'kite.js'

const server = new KiteServer({
  name: 'square',
  auth: false,
  api: {
    square(x, done) { done(null, x * x) }
  }
})

server.listen(9999)

After transport option feature is implemented we will be able to connect to this server with 2 different ways:
import { Kite } from 'kite.js'
import WebSocket from 'ws'

// first the usual one:
const kite = new Kite({
  url: 'ws://localhost:9999',
  auth: false,
})

kite.connect()

// with transport option we will be able to reuse a `ws` connection:
const ws = new WebSocket('ws://localhost:9999')
const kite = new Kite({
  auth: false,
  transport: ws
})

Why do we need this?
Rope server implementation requires bi-directional communication between 2 ends of the websocket connection. If we were to have this way of passing transport objects on Kite client creation, required implementation for Rope can be satisfied within the api limits of Kite and KiteServer:
After introduction of transport option, following would be how we could interact with the other end of the connection:
// client.js
import { Kite } from 'kite.js'

const kite = new Kite({
  name: 'basic-whoami',
  api: {
    whoami(callback) {
      callback(null, 'square')
    }
  }
})

// server.js
import { Kite, KiteServer } from 'kite.js'

const server = new KiteServer({
  name: 'square',
  auth: false,
  api: {
    square(x, done) { done(null, x * x) }
  }
})

// add an event listener directly onto server object of created KiteServer.
server.server.on('connection', connection => {
  const otherKite = new Kite({
    auth: false,
    transport: connection
  })

  otherKite.tell('whoami').then(res => console.log(`Hello my name is ${res}`))
  // => Hello my name is square
})

server.listen(9999)

What i was trying to explain in the beginning was instead of attaching an event listener of the internal server object, we can use existing connection event of KiteServer, and the connection/session object emitted with it will have a kite object attached to it, so if we were to rewrite the last example:
// server.js
import { Kite, KiteServer } from 'kite.js'

const server = new KiteServer({
  name: 'square',
  auth: false,
  api: {
    square(x, done) { done(null, x * x) }
  }
})

// add an event listener directly to our KiteServer instance connection object
// connection object passed to it will have a reference to the caller kite which is an instance of `Kite`
server.on('connection', connection => {
  const otherKite = connection.kite
  otherKite.tell('whoami').then(res => console.log(`Hello my name is ${res}`))
  // => Hello my name is square
})
server.listen(9999)

/cc @gokmen

The only part I'm thinking that we also need to provide a way to get the API definition for both ends, also for the latter example there might not to have a kite implementation on the remote side; there can be a regular websocket connection without using kite libraries which we also need to understand in some way.


Time is not offsetting from GMT?

This is a COPY of Issue 918: Time is not offsetting from GMT?, filed on Google Code before the project was moved on Github.

Submitted on 2011-08-26T22:21:33.000Z by<EMAIL_ADDRESS>Status: Invalid

Please review the original issue and especially its comments. Comments here on closed issues will be ignored. Thanks.
Original description
This is my configuration?

/** Timezone GMT offset */
define( 'YOURLS_HOURS_OFFSET', +1 );

I live in UK so offset is +1 but not working .....time is still 6hours behind with above config?????

This I think is not a GMT offset, but a server time offset.  When set to -5 for USA/New York, I get 5 hours behind now (my server's clock is set to gmt - 5).  When setting it to 0, I get the correct time.

Indeed.


Documents are not retrieved with URL encoded _key

Since slashes are not valid as document _key values, and I need to have URLs as document _key, I was URL encoding them before assigning them as _key. However, when I was using db.document(_id) or db.collection("collection-name"). get(_key), the functions return None. When I used db.collection("collection-name").find({"_id": _id), however, the document was found.
I'm using python 3.7, arango 3.4.4, and python-arango 4.4.0
Below is a minimal example to reproduce the issue:
from urllib.parse import quote_plus
from arango import ArangoClient

client = ArangoClient(protocol='http', host='localhost', port=8529)

sys_db = client.db('_system')
if not sys_db.has_database('test'):
    sys_db.create_database('test')
db = client.db("test")

if db.has_collection('collection1'):
    c = db.collection('collection1')
else:
    c = db.create_collection('collection1')

url_encoded = quote_plus("http://google.com")
c.insert({"_key": url_encoded})

print(db.document(f"collection1/{url_encoded}"))
#  prints: None
print(db.collection("collection1").get(url_encoded))
# prints: None
print(db.collection("collection1").find({"_id": f"collection1/{url_encoded}"}).next())
# prints: {'_key': 'http%3A%2F%2Fgoogle.com', '_id': 'collection1/http%3A%2F%2Fgoogle.com', '_rev': '_YpqexJK---'}

Hi @danielapoliveira,
I was able to reproduce the issue. I was also able to reproduce the issue using the chrome rest client. This looks like a bug on ArangoDB's side. Please open a ticket with them. I will keep this open for any updates. Thanks.

Hi @joowani,
Looks like similar issues have been reported in https://github.com/arangodb/arangodb/issues/5885 and https://github.com/arangodb/arangodb/issues/8166.
These are still open and haven't been updated in a while. I'll follow those issues for any updates.

Thanks for the update @danielapoliveira. Closing this as the problem is not with the client.


Improve SystemVerilog class/endclass lexer rules

The class looks like:
class class_identifier [#(param_decls)] [extends class_identifier #(params)];
...
endclass [: class_identifier]
Using the same Java convention of Keyword.Declaration and Name.Class.
Add a test_systemverilog_classes unit test to test_hdl.

Thanks a lot for your continued contribution! Please keep up the good work :)


semantic categories

hi! How do you achieve showing different semantic categories on one image? I don't seem to see it in the code.

I did not release the visualization codes. Since the semantic mask is a map with multiple number, you can assign each number a color as you want. And I think it's easy to implement.

@hitachinsk correct me if I'm wrong, but basically all that was changed was substituting the number of classes into the num_multimask_outputs value. The original SAM predicts three "multimask" outputs (I think sorted from high to low confidence).
To the best of my knowledge, the MLP hypernetworks predict separate masks, but is it reasonable to expect that the losses can actually propagate to the MLPs? What about another semantic segmentation case where instead of having each pixel on an image assigned to one category, you could have overlapping categories?


[Suggestion] Hide player's inventory when not logged in.

Title.

Based on the experience from bukkit, I don't think this will be a good idea, because other inventory manipulation plugins could produce incompatibility which leads to lost inventories. The only good way is to prevent the network packets, but Sponge doesn't allow us to do that.


feat: web wallet composite

Context
By using the hooks in the React package, we were able to create a WebWallet and ship it in the @fuels/react package.
This can be enabled by using showWebWallet in the FuelProvider.
The default is disabled.
This PR

Adds a new component to improve UX
Depends on https://github.com/FuelLabs/fuel-explorer/pull/467

Screenshots
Light Theme

Dark Theme

Depends on https://github.com/FuelLabs/fuel-explorer/pull/569

Light Theme

Dark Theme

This feature will continue on https://github.com/FuelLabs/fuel-connectors/pull/281


Rename .gitIgnore to .gitignore

The name ".gitIgnore" was not ignoring the push of .env files. Renaming it to ".gitignore" fixed the issue for me. Thus, I am requesting a merge so the future developers do not face the same issue.

thanks so much for raising this! I agree the change makes sense. the original file name was a typo


draft-next drop tests asserting empty fragments in $id are valid

Per https://github.com/json-schema-org/json-schema-spec/pull/1291

also mentioned in https://github.com/marksparkza/jschon/issues/69 but seems to have not led to any action in the test suite

True, that is an option. I question the value of it - it's really just a test of the pattern keyword applied to $id, and pattern is already well-covered with its own tests. But that's true both before and after this change. I'm neutral on it, and will restore the tests with valid: false if others prefer that.

That's a good point. The point of this test suite isn't to test the meta-schema.

The point of this test suite isn't to test the meta-schema.

But it is the point of the suite to verify an implementation adheres to the spec.
I agree that whether the meta-schema enforces that $id doesn't have a fragment is not subject to test.  However, I still think it's the responsibility of the implementation to verify this requirement.

I still think it's the responsibility of the implementation to verify this requirement.

I agree, but I don't think we have the capability to check for that using the test suite. We don't have the ability to test for InvalidSchema type of failures. This test validates a schema against the meta-schema as a kind of workaround for that problem. It doesn't actually check that the implementation is capable of verifying the requirement. It's just testing the meta-schema.

I'm not sure where that brings us as far as either this PR or the rest of the id.json tests that boil down to pattern matching. Should they stay?

I'm not sure where that brings us as far as either this PR or the rest of the id.json tests that boil down to pattern matching. Should they stay?

I'd say that they should probably be removed. It might be interesting to have a suite that specifically tests the meta-schema, but that's not what this is. @Julian, @gregsdennis, what do you think?

Indifferent personally -- the argument for having them (and #354 and #244 in general) is just to help start to collect these tests instead of making no progress there, but I'm not sure we've made meaningful progress there regardless, so it's not much harm removing them either.
(Tl;dr weak +0 for leaving+inverting but very weak)

I don't think we have the capability to check for that using the test suite. We don't have the ability to test for InvalidSchema type of failures.

This is a good point.
If an invalid $id means an invalid schema, and this suite requires valid schemas, then we don't have a way to test this aside from the meta-schema, which this suite isn't intended for.
So.... yeah, I say drop them.

the argument for having them (and https://github.com/json-schema-org/JSON-Schema-Test-Suite/pull/354 and https://github.com/json-schema-org/JSON-Schema-Test-Suite/issues/244 in general) is just to help start to collect these tests instead of making no progress there

This is a great point that I hadn't thought of. But, I also agree that there's not terribly much there and what is there is pretty basic and unlikely to be missed if we recreate this later when we have the capability to set invalid schemas.
So, if no one minds me making the call... @notEthan, would you mind either creating an new PR or updating this one that removes all the meta-schema-based $id tests?

Closing, obviated by https://github.com/json-schema-org/JSON-Schema-Test-Suite/pull/718


Comms: MQTT

Part of #20
The node needs to connect to a MQTT reflector and send/receive messages from it.
There are a LOT of MQTT libraries, and its not clear which is the best - comments are welcome.
My plan is to build on one of them for the POC, and then allow for coming back and re-engineering, ideally just this module, if there is a better one to use.
Its dependent on WiFi connectivity.

[x] Select Library
[x] Integrate WiFi and make sure minimally configurable
[X] Figure out structure for retrieving, storing and then acting on changes (see comment below)
[x] Define APIs to hook this into sensors, logic and actuators
[x]  Build demo to send humidity and set LED accordingly  (see comment)
[ ] Potential issues to come back and check

[ ] In arduino-mqtt/README.md is a comment about "millis" not continuing during deep sleep, and since we'll need deep sleep for the MVP this will need revisiting.
[ ] Need to handle authentication (in client.connect)
[ ] Need to handle device identification - how to subscribe to certain devices, and how to discover those devices.

[ ] Put a MQTT "reflector" somewhere - probably on Mitra's server for now
[ ] Figure out a way to interogate, or be notified of state changes through that server
[ ] Build local reflection - so message is dispatched locally as well as sent to server #26
[ ] Build stand alone reflector - so a network of sensors can collaborate, via WiFi or LoRa hub without backhaul. Reflector should also send on to upstream reflector. #26
[ ] Pull WiFi out of MQTT and make non-blocking #28
[ ] Build higher level MQTT protocol - how devices self-announce, and get backlog of updates etc etc #29

I'm leaning towards lwmqtt because it claims to be simple and light/
There is also a wrapper - https://github.com/256dpi/arduino-mqtt which uses callbacks.

Base level works as a demo - sends and receives a hello world message.  Probably needs some kind of reflector on my naturalinnovation.org server, and then to add authentication.

Need to also think through structure for MQTT variables and payloads. I think this will need copying the payload out of the buffer which might mean dealing with the type.

Design straw person .....

sensor_xxx::loop calls xMqtt:send(topic, value) when value changes.
cXxx::setup calls xMqtt_subscribe(topic, &cXxx::messageReceived)
xMqtt_subscribe calls client.subscribe(topic)
xMqtt::messageReceived looks up topic and calls cXxx::messageReceived with the payload
cXxx::messageReceived

makes a copy of the payload if required.
takes action e.g. calling an actuator.

Next steps would be to do this with the SHT31 sensor, and then an actuator (which could be on a separate device) to turn on LEDS when humidity exceeds base level

There is now a live working demo where a SHT30 sensor detects humidity , sends it to the MQTT server. Then control_demo_mqtt receives that value, checks against a reference humidity and sends a value via the MQTT server to actuator_ledblinken.
Note that this should work even if the LED and SHT30 are on different devices, but I don't currently have a way to test that.

Closing as all minor issues (with own issues) and MQTT is working well -


Implementation of AIT

This is the proposed implementation of AIT, as discussed in #33 .

Hello Tristan,
Thanks for the work. I just had a quick look at the code. It looks good. Nice work.
I will not be able to look at it more closely and merge it before the end of next week (I won't bring any computer during my vacations...) But I will definitely do it, just be patient.
Just one small point. I would prefer you keep the same exact coding style and presentation as the rest of the project. I do not criticize your coding style. There are some bad - or even very bad - coding styles and many different good coding styles. Your style is a good one. But inside a given project, there is only one recommended style, the same consistent one as the rest of the project.
PS: I pushed a couple of commits last night that you may want to merge. I promise not to push any other in the next 10 days for the aforementioned reason.
Thanks

Sure take your time, there is no rush.
About the coding style, thanks for pointing that out, I should have taken more care of it. In fact, I let my editor (vim) take care of autoformatting everything and didn't look further. I will change that to match the rest of the project while merging the most recent changes.

Integrated, thanks for your work.
Feel free to add more contributions regarding HbbTV signalling.

Hi @ElyKar
I see something strange in the dump of the AIT from the test stream (which is a real world stream from Eutelsat 13°E).
* AIT, TID 116 (0x74), PID 7877 (0x1EC5)
  Version: 0, sections: 1, total size: 182 bytes
  - Section 0:
    Application type: 1 (0x0001), Test application: 0
    Application: Identifier: (Organization id: 11 (0x0000000B), Application id: 6837 (0x1AB5)), Control code: 2
    - Descriptor 0: AIT Application (0x00, 0), 9 bytes
      0000:  05 00 01 01 01 01 3F 3C 01                 ......?<.
    - Descriptor 1: AIT Application Name (0x01, 1), 23 bytes
      0000:  69 74 61 13 50 72 6F 67 72 61 6D 6D 69 20  ita.Programmi
      000E:  54 56 20 42 42 20 53 41 54                 TV BB SAT
    - Descriptor 2: Hierarchy (0x04, 4), 43 bytes
      0000:  01 2F 00 69 74 2E 6D 65 64 69 61 73 65 74  ./.it.mediaset
      000E:  2E 73 63 68 65 64 75 6C 65 73 74 76 2E 50  .schedulestv.P
      001C:  6F 72 74 61 6C 65 4C 69 67 68 74 58 6C 65  ortaleLightXle
      002A:  74                                         t
    - Descriptor 3: Audio Stream (0x03, 3), 0 bytes
    - Descriptor 4: AIT Transport Protocol (0x02, 2), 72 bytes
      0000:  00 03 01 30 68 74 74 70 3A 2F 2F 6D 68 70  ...0http://mhp
      000E:  2E 64 67 74 76 2E 6D 65 64 69 61 73 65 74  .dgtv.mediaset
      001C:  2E 69 74 2F 61 70 70 6C 2F 50 72 6F 67 72  .it/appl/Progr
      002A:  61 6D 6D 69 54 76 53 61 74 2F 01 12 50 72  ammiTvSat/..Pr
      0038:  6F 67 72 61 6D 6D 69 54 76 53 61 74 2E 7A  ogrammiTvSat.z
      0046:  69 70                                      ip

All descriptors have tags below 0x3F, the overlapping range between ISO 13818-1 (MPEG-TS) and ETSI TS 102 809 (HbbTV signalling). Since we are in an AIT, the HbbTV values prevail. We can see that descriptor tags 0x00, 0x01 and 0x02 are correctly recognized as AIT-specific. However, descriptor tags 0x03 and 0x04 are also present and these values are not defined in ETSI TS 102 809. Looking at descriptor number 2, tag 0x04, it is obvious that this is an HbbTV information and not an MPEG-defined hierarchy descriptor. Similarly, it seems doubtful that descriptor number 3 is an MPEG-defined audio descriptor.
Do you have any idea where these two obviously AIT-specific descriptor tags 0x03 and 0x04 come from? My copy of ETSI TS 102 809 is the latest one, v 1.3.1 from June 2017, and they are not documented there.

Hi, I suspect these descriptors are defined in DVB-MHP specification. Here is the table layout according to dvbsnoop :
$ dvbsnoop -s ts -N 3 -tssubdecode -if test-018.ts 0x1ec5
    ....
    TS sub-decoding (1 packet(s) stored for PID 0x1ec5):
    =====================================================
    TS contains Section...
    SI packet (length=182):
        PID:  7877 (0x1ec5)

        Guess table from table id...
        AIT-decoding....
        Table_ID: 116 (0x74)  [= MHP- Application Information Table (AIT)]
        Section_syntax_indicator: 1 (0x01)
        reserved_1: 1 (0x01)
        reserved_2: 3 (0x03)
        section_length: 179 (0x00b3)
        test_application_flag: 0 (0x00)
        application_type: 1 (0x0001)  [= DVB-J application]
        reserved_3: 3 (0x03)
        Version_number: 0 (0x00)
        Current_next_indicator: 1 (0x01)  [= valid now]
        Section_number: 0 (0x00)
        Last_section_number: 0 (0x00)
        reserved_4: 15 (0x0f)
        common_descriptors_length: 0 (0x0000)

        reserved_5: 15 (0x0f)
        application_loop_length: 166 (0x00a6)
            organisation_id: 11 (0x0000000b)
            appliction_id: 6837 (0x1ab5)  [= unsigned applications]
            application_control_code: 2 (0x02)  [= PRESENT]
            reserved: 15 (0x0f)
            application_descriptor_loop_length: 157 (0x009d)

               MHP_AIT-DescriptorTag: 0 (0x00)  [= Application descriptor]
               descriptor_length: 9 (0x09)
               application_profile_length: 5 (0x05)

                  application_profile: 1 (0x0001)
                  version.major: 1 (0x01)
                  version.minor: 1 (0x01)
                  version.micro: 1 (0x01)

               service_bound_flag: 0 (0x00)
               visibility: 1 (0x01)  [= application not visible to user, but visible to appl. listening api]
               reserved: 31 (0x1f)
               application_priority: 60 (0x3c)
               transport_protocol_label: 1 (0x01)

               MHP_AIT-DescriptorTag: 1 (0x01)  [= Application name descriptor]
               descriptor_length: 23 (0x17)
                  ISO639_language_code:  ita
                  application_name_length: 19 (0x13)
                  application_name: "Programmi TV BB SAT"  -- Charset: Latin alphabet

               MHP_AIT-DescriptorTag: 4 (0x04)  [= DVB-J application location descriptor]
               descriptor_length: 43 (0x2b)
               base_directory_length: 1 (0x01)
               base_directory: "/"
               classpath_extension_length: 0 (0x00)
               classpath_extension: ""
               initial_class: "it.mediaset.schedulestv.PortaleLightXlet"

               MHP_AIT-DescriptorTag: 3 (0x03)  [= DVB-J application descriptor]
               descriptor_length: 0 (0x00)

               MHP_AIT-DescriptorTag: 2 (0x02)  [= Transport protocol descriptor]
               descriptor_length: 72 (0x48)
               protocol_id: 3 (0x0003)  [= Transport via HTTP over the interaction channel]
               transport_protocol_label: 1 (0x01)

               URL_base_length: 48 (0x30)
               URL_base: "http://mhp.dgtv.mediaset.it/appl/ProgrammiTvSat/"

               URL_extension_length: 1 (0x01)
               URL_extension: "."

               URL_extension_length: 80 (0x50)
               URL_extension: "rogrammiTvSat.zip...x..........................................................."

    CRC:<PHONE_NUMBER> (0xad9f1778)

The last descriptor is not decoded correctly, however given that the application transmitted is a Java app, it seems plausible to me that this stream uses the MHP spec and not TS 102 809 (To be honest, I don't really understand what they did with the AIT and descriptors, because it's been defined years ago for MHP and they moved it to a new spec after that).

You are right, they are defined in ETSI TS 101 812. I will add the corresponding definitions.

@ElyKar
Here is a summary of AIT / HbbTV availability on the French TNT. The UHF channels are valid for the Paris - Tour Eiffel transmitter. I can provide captures if you need some.
LCN   Channel     TS    UHF   AIT PID   HbbTV carousel PID
---   ---------   ---   ---   -------   ------------------
1     TF1         R6    32    0x00AA   n/a
4     Canal+      R3    22    0x03B7   n/a
6     M6          R4    30    0x00AA   0x00AB (100 kb/s)
7     Arte        R4    30    0x0172   0x0173 (20 kb/s)
8     C8          R2    25    0x00AA   n/a
12    NRJ12       R6    32    0x010E   0x010F (50 kb/s)
13    LCP         R6    32    0x0302   n/a
16    CNEWS       R2    25    0x01D6   n/a
17    CSTAR       R2    25    0x023A   n/a
18    Gulli       R2    25    0x029E   0x029F (50 kb/s)
25    Chérie 25   R10   42    0x0172   0x0173 (50 kb/s)


doc(deploy): fix examples with list keys

Resolves #148

:tada: This PR is included in version 4.6.0 :tada:
The release is available on:

v4.6.0
GitHub release

Your semantic-release bot :package::rocket:


Using this library in Lambda at Edge - Cloudfront

Question
Based on https://github.com/awslabs/aws-jwt-verify#cloudfront-lambdaedge - I included the code in a edge lambda function, however, I got following error >>
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module 'aws-jwt-verify'\nRequire stack:\n- /var/task/EdgeAuth.js\n- /var/runtime/index.mjs",
"stack": [
    "Runtime.ImportModuleError: Error: Cannot find module 'aws-jwt-verify'"

What do I need to do to include this in my lambda function (this is Viewer request lambda function on Cloudfront)
Versions
Which version of aws-jwt-verify are you using?

latest
Are you using the library in Node.js or in the Web browser?
Node.js, I think (using it in Lambda at Edge function)
If Node.js, which version of Node.js are you using? (Should be at least 14)
16

A couple follow up questions:

Can you provide details on how you are building and deploying this Lambda function?
Can you share any webpack or TypeScript config files that impact that build?
Does the code work locally (e.g. when you unit test)?

Its a lambda function that's tied to a Cloudfront distribution & gets triggered on "viewer request"
I use CDK to bundle all my infrastructure - including CF distribution and the lambdas
There's no "build" phase - as the code gets zipped up & deployed as part of cdk synth & deploy phases (through AWS Codepipeline, actually) Given lambda at edge does not allow any layers, I can't "include" custom libraries

Has anyone tried to successfully integrate this with lamda-at-edge (Cloudtfront)?
Refer this link for the default modules present for CF lambda functions https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-javascript-runtime-features.html#writing-functions-javascript-features-builtin-modules
I was hoping this library would be "integrated" in above list of modules so its available for all JS CF functions.

CloudFront provides two ways to write and manage edge functions: CloudFront Functions and Lambda@Edge.  The link above refers to CloudFront Functions.  NodeJS dependencies included in package.json should work with that CDK build - it doesn't require Lambda Layers.
Can you share the snippet of your CDK code for this Lambda@Edge and the dependencies from your package.json ?

here's package.json >>
"dependencies": {
"aws-cdk-lib": "2.59.0",
"aws-jwt-verify": "^4.0.0",
"constructs": "^10.0.0",
"source-map-support": "^0.5.21"
}
& CDK extract:
const cloudfront_handler = new lambda.Function(this, "CDNAuthorizer", {
functionName: "CDNAuthorizer",
runtime: lambda.Runtime.NODEJS_16_X,
handler: "EdgeAuth.handler",
description:
"A lambda function for checking authZ for cloudfront requsts",
code: lambda.Code.fromAsset("lambdas"),
logRetention:
stageName == "prod" ? RetentionDays.ONE_YEAR : RetentionDays.FIVE_DAYS,
});
...

edgeLambdas: [
{
functionVersion: cloudfront_handler.currentVersion,
eventType: cloudfront.LambdaEdgeEventType.VIEWER_REQUEST,
},
],
& the js >>
const { CognitoJwtVerifier } = require("aws-jwt-verify");
const jwtVerifier = CognitoJwtVerifier.create({
userPoolId: "xxxx",
tokenUse: "access",
clientId: "zzzzz",
scope: "read",
});
exports.handler = async (event) => {
const request = event.Records[0].cf.request;
const params = querystring.parse(request.querystring);
const accessToken = params.token;
try {
await jwtVerifier.verify(accessToken);
} catch {
return {
status: "403",
body: "Unauthorized",
};
}
return request; // allow request to proceed
};

I recommend you switch to NodejsFunction which extends lambda.Function and represents "A Node.js Lambda function bundled using esbuild"
import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';

Otherwise, I suspect your build doesn't do a build step for the lambda function - something like cd lambdas && npm install

There is nothing special about this library in Lambda@Edge, if will work as any other dependency: you just need to include it in your Lambda deployment package.
There's various ways to do that: e.g. @hakanson suggestion to use NodejsFunction as that automatically does installation of dependencies into the Lambda deployment package.
An example of using this library in Lambda@Edge code can be seen here: https://github.com/aws-samples/cloudfront-authorization-at-edge/blob/c4251988dc4b8d4e858c580e2f95f6577284111c/src/lambda-edge/shared/shared.ts#L12
In that repo we use webpack to bundle the dependency into the Lambda deployment package.


[Adaptive] [DCR] Standard property naming

turn Standard Properties

turn.activity - current activity (no change) (AdaptiveDialog only)
turn.recognized  - current result of IRecognizer

intents
entities

turn.stepcount - number of executed steps (AdaptiveDialog only)
dialog Standard properties

dialog

options - the options object which is used to initialize the dialog.  NOTE: This is blend of declarative dialog properties and options set when invoking.  This allows you to data bind to configured values like MaxValue via dialog.this.options.maxValue.
this - (NEW) for container dialogs where child dialogs share the state (like Adaptive dialog's and steps) the this property is standard property for internal dialog book keeping

step - (NEW) active step property bag

Memory Shortcuts

$ for slot shortcut (no change)
- $xxxx -> dialog.xxxx
# for intent shortcut (no change)
- #xxxx -> turn.recognized.intents.xxxx
@ for entity shortcut (no change)
- @xxxx -> turn.recognized.entities.xxxx
^ for options shortcut (NEW) - this makes it easy to databind to configured options, aka, "The maximum age we accept is {^maxValue}" <-- data bind to configured maxValue option
- ^xxxx -> dialog.this.step.options.xxxx || dialog.this.options.xxxx

Data Binding
Data binding is the process of configuring the data from the memory context of the caller to the memory context of a dialog.  We spent a fair amount of time digging into this and the net result is the following recommendations.
There are several patterns of calling a dialog (aka function):

1..N input or argument bindings (aka, properties which are memory from the caller that get mapped into memory of the target)
1 output or result binding (aka, where the result of calling the dialog
2 way bindings (object is passed in and result is set as the result)

Our guidance around this is:

Input properties should be expressed as properties which are a a string which is evaluated as an expression (either const or path to value)  (CHANGE)
If there is not a 2 way binding then the result property should be called ResultProperty and expressed as a string which is evaluated as a property path (CHANGE)
If there is a 2 way bindings it should also be called XXXXProperty expressed as a string which is evaluated as a property path(CHANGE)
Our input dialogs are about 2 way data binding to a value, and so we should standardize on the name ValueProperty

Example:
{
   "$type":"Microsoft.NumberProperty",
   "minValue":"13",
   "maxValue":"{dialog.parentAge}", // data binding maxValue to caller's value of dialog.parentAge
   "valueProperty":"dialog.age";  // two-way property binding
}

The base dialog has support for data bindings, but we should change the name to reflect their role and also that they should not be probably used unless you know what they are for.  To that end we should

Rename InputProperties and OutputProperty -> InputBindings and OutputBindings.  (CHANGE)
Best practice is to not expose InputBindings and OutputBindings in our json schema, but instead have user friendly properties which get mapped to Input/OutputBindings internally.

Tracked via #1966 1966


dbs-boot: arm add dbs-boot crate

This PR adds the arm dbs-boot crate, which mainly involves three modifications:

Add arm layout.rs.
Add fdt.rs to inform the guest kernel device information.
Add the dtb file for unit-test to ensure that the fdt build is basically correct.

Is output.dtb used for test? If so, should we move it to crates/dbs-boot/test?

done

Is output.dtb used for test? If so, should we move it to crates/dbs-boot/test?

done, I have move it to crates/dbs-boot/src/aarch64/test


Missing icon in hide search highlights button

The Hide Search Matches button has a broken icon in our stable docs:

I think because the CSS variable isn't defined:

it works from my side, I'm just missing the color:

could you try with latest as well ?

Though the error message above is not that the glyph is invalid, but that the variable is not defined. That's what makes me wonder if it is a cache thing

100% sure it exists : https://github.com/pydata/pydata-sphinx-theme/blob/88d30a086570136e998998103ce6fe23cc4424de/src/pydata_sphinx_theme/assets/styles/variables/_icons.scss#L20
so yes if you can empty your cache and test it again that would be perfect

Hmmm I tried locally with a different browser (edge) and got the same thing. I'm not sure what's going on. Let's wait and see if anybody else reports?


Disallow merging if PR has been rejected

If you request changes on a PR, you are still able to merge it. Github disallows merging if a PR is rejected.

Was not there issue already about this?

Not that I was able to find.

@FryDay  I think a PR is rejected by someone could still be merged on Github.

Only someone with admin privileges, and you need to click through warnings to do it.

@FryDay yes, we could follow that.

AFAIK the reject information stored inside of a review, that is connected to a comment.
In order to disable a pull request, all comments of an issue have to be process, checking if the rejection is still valid.
This solution become a problem depending on the amount of comments.
One possible solution could be changing the relation between comment and review to issue and review.
This solution could lead to

a better runtime (less entries inside a loop)
a listing who reject a pull request

this could be used to remove reject status by an administrator

possibility to create a rule that a review is required in order to merge

Based on the solution described in the previous comment, there is a way with less refactoring.
The issue is extended with the review, the review remain inside the comment.
The issue indexer process the comments and create the review inside the issue based on the information inside the comment.
Did not know how often the indexer is running and how long it will take ro process the data.

I will have a look inside this issue.
Other issues going in the same direction:

#3588
#996


Fix division by zero during CJK training.

I met floating point error during training Japanese model.
Here is gdb output.
Program received signal SIGFPE, Arithmetic exception.
0x00007fcca7c14f5c in tesseract::LocalCorrelation::EstimateYFor (this=0x7ffdeae919d0, x=45, r=0.100000001)
    at src/textord/cjkpitch.cpp:165
165         return rc / vote;

This PR fixes the issue.

Note: we need to squash such PRs on merging.

Note: we need to squash such PRs on merging.

https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-request-merges#squash-and-merge-your-pull-request-commits


Win10 iot core

Adding support for building the OpenSSL's deliverables for Win10 IoT core.

You are making these changes on the wrong branch. It is highly unlikely that we will add new platform support to a released branch. You should apply them to master instead.

according to: https://github.com/openssl/openssl/issues/971
I thought that I've to put it to 1.0.2 line.
So the ultimate question is: If I'll create PR to master branch, is it going to land in a 1.0.2 line ever?

No. 1.0.2 is a stable branch. We don't add new features or platforms - they only appear in new releases.

Ok. I'll work on pr to master branch instead.

And just to set expectations:  we're in bugfix only right now for 1.1, so this will be in a future release.


Add docker support

Can you expand on what is needed for this to happen? All of the benchmarking tools I have found thus far rely on docker to make them portable and reviewable. If we want to use the industry standard metrics we will want to do it using docker. Happy to look into this

We already have both docker and pyxis installed on the cluster.
Remaining actions required:
Can we pull docker images?
Can we push to dockerhub?
Can we build a new image?
What are the steps to get slurm to run a docker container for a user?
We also need to write the documetation for it.
Slurm does integrate with docker nicely (and other cotainerization tools).  I'd prefer to have slurm do a docker deploy then having users sbatch or srun then manually launch docker.
I think there's a command like
srun --container blah

For some additional context. We have both docker and pyxis installed on the cluster already.
Things that need to done for this ticket.
Can we pull docker images?
Can we push to docker hub?
Can users build a container locally?
What are the steps are required to run docker on the cluster?
Does the slurm docker integration work?
The documentation for the users also needs to be written.

@steven-basart
#148
Closing.


LHN display wrong message when edit message to mention someone

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Version Number: 9.0.3-6
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @dukenv0307
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1719934953730129
Action Performed:

Send a random message
Edit this message to mention someone

Expected Result:
LHN shows the mentioned person
Actual Result:
LHN shows welcome message
Workaround:
unknown
Platforms:

Which of our officially supported platforms is this issue occurring on?

[ ] Android: Native
[ ] Android: mWeb Chrome
[ ] iOS: Native
[ ] iOS: mWeb Safari
[x] MacOS: Chrome / Safari
[ ] MacOS: Desktop

Screenshots/Videos
https://github.com/Expensify/App/assets/38435837/11ae5418-f0ae-4299-9dd4-15754c58fa28
https://github.com/Expensify/App/assets/38435837/da4ff17a-bbf6-4c11-a476-244f2759fcfe

View all open jobs on GitHub

W/O edit but only reference email address

It shows "@[user name]" on LHN.
The reference email address with edit

API response get empty value for text key when editing message into email address.

This issue occurs because the backend does not return the mentioned user in the lastMessageText in the updateComment API response like below.
Therefore, this issue should be handled in the backend.

I can reproduce this. However, it only occurs until you navigate away and back to the chat. Once you do, the LHN updates to show the mention you edited the message to (seen at the end of my video). This feels like a pretty low impact bug to fix ATM, since it only happens if you send a regular message and edit it to add a mention, it fixes itself once you leave and go back to the chat, and we paused the #vip-vsb project (where this would be slotted in).
https://github.com/Expensify/App/assets/54866469/3ec4ebc6-e233-4e3b-abc0-37f1ef0f11d3

I think we should close this for now, and reprioritize it if we get any actual feedback from customers on this. Doing that for now, but LMK if anyone disagrees.


Trying to deploy azure_sql_database results in "Invalid parameter elastic_pool_name"

What you expected to happen?
A new Microsoft SQL server to be deployed.
What happened?
Error: Failed to apply catalog: Validation of Azure_sql_database[wre-dellegance-db-copy] failed: Invalid parameterelastic_pool_name(:elastic_pool_name
Anything else we need to know?
"elastic_pool_name" is an optional parameter according to the documentation.  I didn't have that parameter in my manifest at all.  Yet the module failed because it said a parameter I didn't even supply was invalid.
I tried specifying an elastic_pool_name, just to see what would happen, and got the same error.
Versions:
Error: Failed to apply catalog: Validation of Azure_sql_database[wre-dellegance-db-copy] failed: Invalid parameter elastic_pool_name(:elastic_pool_name) (file: /etc/puppetlabs/code/environments/production/modules/azuretest/manifests/init.pp, line: 54)
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/errors.rb:157:in `fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:639:in `[]'
/opt/puppetlabs/puppet/cache/lib/puppet/type/azure_sql_database.rb:21:in `block (3 levels) in <top (required)>'
/opt/puppetlabs/puppet/cache/lib/puppet/type/azure_sql_database.rb:19:in `each'
/opt/puppetlabs/puppet/cache/lib/puppet/type/azure_sql_database.rb:19:in `block (2 levels) in <top (required)>'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2399:in `initialize'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource.rb:478:in `new'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource.rb:478:in `to_ral'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:629:in `block in to_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:621:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:621:in `to_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:515:in `to_ral'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:111:in `block in convert_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:518:in `block in thinmark'
/opt/puppetlabs/puppet/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:517:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:105:in `convert_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:168:in `prepare_and_retrieve_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:341:in `run_internal'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:239:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:252:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:217:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:59:in `block (5 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/2.5.0/timeout.rb:93:in `block in timeout'
/opt/puppetlabs/puppet/lib/ruby/2.5.0/timeout.rb:103:in `timeout'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:58:in `block (4 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent/locker.rb:21:in `lock'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:52:in `block (3 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:130:in `with_client'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:49:in `block (2 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:87:in `run_in_fork'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:48:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:179:in `controlled_run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:46:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/agent.rb:372:in `onetime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/agent.rb:350:in `run_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:382:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:671:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:382:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:135:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:73:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'

root@puppet:~# puppet --version
6.0.5
root@puppet:~# facter os
{
  architecture => "amd64",
  distro => {
    codename => "bionic",
    description => "Ubuntu 18.04.2 LTS",
    id => "Ubuntu",
    release => {
      full => "18.04",
      major => "18.04"
    }
  },
  family => "Debian",
  hardware => "x86_64",
  name => "Ubuntu",
  release => {
    full => "18.04",
    major => "18.04"
  },
  selinux => {
    enabled => false
  }
}
root@puppet:~# puppet module list
/etc/puppetlabs/code/environments/production/site-modules
├── profile (???)
└── role (???)
/etc/puppetlabs/code/environments/production/modules
├── azuretest (???)
├── puppetlabs-azure_arm (v0.2.1)
└── puppetlabs-stdlib (v5.2.0)
/opt/puppetlabs/puppet/modules
├── puppetlabs-facter_task (v0.4.0)
├── puppetlabs-package (v0.4.1)
├── puppetlabs-pe_accounts (v2016.5.0)
├── puppetlabs-pe_bootstrap (v0.3.0)
├── puppetlabs-pe_concat (v1.1.1)
├── puppetlabs-pe_hocon (v2019.0.0)
├── puppetlabs-pe_infrastructure (v2018.1.0)
├── puppetlabs-pe_inifile (v1.1.3)
├── puppetlabs-pe_install (v2018.1.0)
├── puppetlabs-pe_java_ks (v2016.4.0)
├── puppetlabs-pe_nginx (v2017.1.0)
├── puppetlabs-pe_postgresql (v2016.5.0)
├── puppetlabs-pe_puppet_authorization (v2016.2.0)
├── puppetlabs-pe_r10k (v2016.2.0)
├── puppetlabs-pe_razor (v1.1.0)
├── puppetlabs-pe_repo (v2018.1.0)
├── puppetlabs-pe_staging (v0.3.3)
├── puppetlabs-pe_support_script (v2.10.0)
├── puppetlabs-puppet_conf (v0.3.0)
├── puppetlabs-puppet_enterprise (v2018.1.0)
└── puppetlabs-service (v0.5.0)

This one has me stumped, although I haven't done a deep dive into the code yet.

Thank you @Monual for your contribution.Will be taking a look on the issue.Thank you.

Some additional commentary while I was trying to get this to work:
lib/puppet/type/azure_sql_database.rb lists these required properties:
   required_properties = [       :location,       :elastic_pool_name,       :parameters,       :recommended_elastic_pool_name,       :resource_group_name,       :server_name,     ]
This is wrong in multiple ways.  elastic_pool_name and recommended_elastic_pool_name are not required.  However, subscription_id, and api_version_name are required.
Also, 'elastic_pool_name' and 'recommended_elastic_pool_name' weren't even defined as properties.  I had to add the following to azure_sql_database.rb::
  newproperty(:elastic_pool_name) do     desc "Elastic Pool Name."     validate do |value|       true     end   end   newproperty(:recommended_elastic_pool_name) do     desc "Recommended Elastic Pool Name."     validate do |value|       true     end   end
Also, there are two lines in lib/puppet/provider/azure_sql_database/azure_sql_database.rb that assume that elastic_pool_name and recommended_elastic_pool_name are required parameters.  I changed them from:
`
self.call_op(path_params, query_params, header_params, body_params, "management.azure.com", "/subscriptions/%{subscription_id}/resourceGroups/%{resource_group_name}/providers/Microsoft.Sql/servers/%{server_name}/elasticPools/%{elastic_pool_name}/databases", "Get", "[application/json]")
self.call_op(path_params, query_params, header_params, body_params, "management.azure.com", "/subscriptions/%{subscription_id}/resourceGroups/%{resource_group_name}/providers/Microsoft.Sql/servers/%{server_name}/recommendedElasticPools/%{recommended_elastic_pool_name}/databases/%{database_name}", "Get", "[application/json]")
to:
defined?(elastic_pool_name) && self.call_op(path_params, query_params, header_params, body_params, "management.azure.com", "/subscriptions/%{subscription_id}/resourceGroups/%{resource_group_name}/providers/Microsoft.Sql/servers/%{server_name}/elasticPools/%{elastic_pool_name}/databases", "Get", "[application/json]")
defined?(recommended_elastic_pool_name) && self.call_op(path_params, query_params, header_params, body_params, "management.azure.com", "/subscriptions/%{subscription_id}/resourceGroups/%{resource_group_name}/providers/Microsoft.Sql/servers/%{server_name}/recommendedElasticPools/%{recommended_elastic_pool_name}/databases/%{database_name}", "Get", "[application/json]")
`
After I did all of the above, I got my SQL database to deploy.
I will put in a PR, likely tomorrow.

@Monual Thanks a lot for raising the Issue and the PR.The fix is available in the master.Apologies for the delay.


Feature: Cost Explorer

Initial implementation that covers the following features:

create_cost_category_definition
delete_cost_category_definition
describe_cost_category_definition
update_cost_category_definition

Closes #3166

Codecov Report

Merging #5273 (b1c7757) into master (068032a) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #5273      +/-   ##
==========================================
- Coverage   95.96%   95.95%   -0.01%
==========================================
  Files         688      693       +5
  Lines       69062    69148      +86
==========================================
+ Hits        66274    66352      +78
- Misses       2788     2796       +8

Flag
Coverage Δ

servertests
36.13% <28.73%> (-0.02%)
:arrow_down:

unittests
95.89% <100.00%> (-0.01%)
:arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

moto/backend_index.py
100.00% <ø> (ø)

moto/__init__.py
97.22% <100.00%> (+0.01%)
:arrow_up:

moto/ce/__init__.py
100.00% <100.00%> (ø)

moto/ce/exceptions.py
100.00% <100.00%> (ø)

moto/ce/models.py
100.00% <100.00%> (ø)

moto/ce/responses.py
100.00% <100.00%> (ø)

moto/ce/urls.py
100.00% <100.00%> (ø)

moto/resourcegroupstaggingapi/models.py
82.93% <0.00%> (-0.60%)
:arrow_down:

moto/sns/models.py
96.83% <0.00%> (-0.40%)
:arrow_down:

moto/route53/responses.py
96.05% <0.00%> (-0.33%)
:arrow_down:

... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2fce81...b1c7757. Read the comment docs.


Fixed broken link to a spring tutorial

@avivmu Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.

@avivmu Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.

@pivotal-issuemaster This is an Obvious Fix

@pivotal-issuemaster This is an Obvious Fix

@avivmu This Pull Request contains an obvious fix. Signing the Contributor License Agreement is not necessary.

@avivmu This Pull Request contains an obvious fix. Signing the Contributor License Agreement is not necessary.


Symbol labels missing when importing part C150858

Part C150858 (Skyworks RFX2411) in a QFN-20 package is not being generated properly.
The designations seem correct, but all the visual pin labels are missing:

The EasyEDA symbol has them:

I have updated to 1.0.30, same issue as in 1.0.18 which I used before.

Hi, thanks for reporting this issue.
Unless I am mistaken, KiCad does not allow hiding only one pin name, while EasyEDA allows it. In KiCad, the pin name option is defined in the symbol properties and is applied to all pins.
This is the case for pin 21, which has a hidden pin name on EasyEDA.
For symbols I tested this on, most of them either had no pin name hidden or all of them. Therefore, if one of them is hidden, I apply it on all pins. As a first fix, you can manually edit the symbol property to set the "show pin name" option.
Another solution is instead of hiding all the pin names, to set the pin name to an empty string. It would have the same visual effect, but the pin name information is lost.
Let me know what you think.

I think this probably then becomes an issue for many QFN cases because all of them have these middle GND thermal pads.
I would say it is probably not a 'fail safe default' to then hide all pins in the KiCAD output.

Thanks a lot!


Move MaybeKnown enum to shared_vcx

The MaybeKnown<T> enum is used for deserializing a type which could also deserialize to String, essentially trying the Known<T> variant first with the specified type (generally some other enum T) and falling back to the Unknown(String) variant if the first one fails.
This is right now declared in the messages crate as that's where it is mainly used, but does not really belong there as it fits a more general purpose, hence should be moved to the shared_vcx crate.
Moreover, the type could be extended to fit some other use cases by using a second generic as Unknown(U) (which could very well default to String as that's the most common use case).
Steps:
- [ ] Move MaybeKnown<T> to shared_vcx.
- [ ] To make it more extensible, add a second generic to the type which defaults to String (as that's the most common use case and this way existing code wouldn't break).

I would like to work on this!


Week of Feb 12 changes

More model/spec sync'ing
clarify that attribute.item.type is only used by map/array attributes (not objects)
ifvalue.VALUE must be a string serialization of the possible runtime value
ifvalue.VALUE must not be an empty string
ifvalue can not include nested ifvalue
can't implicitly create higher-level entities if they have clientrequired attributes
add attribute.default to define an attribute's default value
default attribute.versions to zero (unlimited versions), was 1
more possible topics for the primer

Approved on the 2/15 call


rewrite module and secure cookies

When rewriting happens with an https destination, like in ws --rewrite '/:user/repos/:name -> https://api.github.com/repos/:user/:name', cookies set by the destination are usually set with the secure flag, but since lws listens on http, this cookie gets lost.
lws should strip the secure flag from the cookie, so cookies set from an https origin get set correctly.

Hi, thanks for the feature - do you think it should be on by default?

Yes I think so. Since lws is "A lean, modular web server for rapid full-stack development." i think it should be on in the default use case, that is, development.

yeah, i agree.. the only concern is that making this behaviour the default could surprise existing users accustomed to the previous behaviour.. It's a breaking change, unless people consider it a bug fix and not feature addition..

True. And when testing specifically for secure

True. But I think that since it did not work before, nobody used lws this way, so there should be no breaking changes for anyone.

Released in lws-rewrite v2.1.0. Reinstall local-web-server to pick up the change.
On insecure connections (plain HTTP), stripping the secure attribute from remote, rewrite-target cookies is now the default behaviour. Set the --rewrite.keep-secure-attr to disable this.


Glowstone disappears from Chalk Box when closed, when running on server.

This issue only happens when running the mod on a server. In my case I am using an Apex MC server. When I put Glowstone or Glow Ink Sacks in the Chalk Box, the glow item is deleted as soon as I close the Chalk Box UI. The glow item also disappears when I try to remove it from the slot in the chalk box. The bar that represents the amount of glow uses also is reset when closing the UI.
So far have not been able to replicate this behavior in Single Player. I also validated all of the config files to make sure the glow settings are what I expect.

Fixed in 1.6.3.


get/put FSM supervisor PID leak when overload protection is enabled [JIRA: RIAK-2157]

Calls to riak_kv_get_fsm_sup:start_get_fsm leave abandoned PIDs in the riak_kv_get_fsm_sup state because FSMs are linked to a sidejob supervisor rather than the get FSM supervisor. A similar issue applies to the put FSM supervisor. This can cause extended shutdown times as the supervisor attempts to iterate through millions of dead PIDs.

Do you have a reproducer or customer ticket this came from?

I've reproduced the issue by doing the following from riak attach on a new node:
supervisor:count_children(riak_kv_get_fsm_sup).
[{specs,1},{active,0},{supervisors,0},{workers,0}]
riak_kv_get_fsm_sup:start_get_fsm(node(), [<<"">>, <<"bucket">>, <<"key">>, []]).
{ok,<0.5520.0>}
process_info(list_to_pid("<0.5520.0>")).
undefined
supervisor:count_children(riak_kv_get_fsm_sup).
[{specs,1},{active,0},{supervisors,0},{workers,1}]

The riak_kv_get_fsm_sup should be deprecated. The only consumer I could find is riak_repl_util:reap/3 called in riak_repl_util:do_repl_put/3 which could be modified to just call start_link instead.
If using sidejob it would obey overload protection which is a good thing and not create a link to the calling process.  The case where overload protection is disabled is more tricky - if the FSM crashes it would be linked to the caller.  reap/3 could call unlink, but there is a race.
We should check with cliserv if there has been a case where we have disabled sidejob.  It was a 'get-out-of-jail' option while the code proved itself in production, so we could clean all of that stuff up to just require sidejob.
/cc: @JeetKunDoug

It seems incorrect that riak_kv_get_fsm:start_link does not link to the caller when sidejob is enabled as that breaks the expected semantics of start_link. One fix I've been thinking of is to manually call link when sidejob is used. However, the reason start_link has been used seems to be just an artifact of avoiding the get_fsm_sup for performance reasons. Based on my discussions with others in cliserv, we have not seen anyone disabling the FSM limit, so I agree that the cleanest solution would be to always use sidejob and perhaps rename the start function to reflect that it does not link to its caller.

Probably go with the rename. You could set up a monitor instead. That
should return exit on an already dead pid.
On Mon, Oct 5, 2015 at 6:18 PM ian-mi<EMAIL_ADDRESS>wrote:

It seems incorrect that riak_kv_get_fsm:start_link does not link to the
caller when sidejob is enabled as that breaks the expected semantics of
start_link. One fix I've been thinking of is to manually call link when
sidejob is used. However, the reason start_link has been used seems to be
just an artifact of avoiding the get_fsm_sup for performance reasons. Based
on my discussions with others in cliserv, we have not seen anyone disabling
the FSM limit, so I agree that the cleanest solution would be to always use
sidejob and perhaps rename the start function to reflect that it does not
link to its caller.
—
Reply to this email directly or view it on GitHub
https://github.com/basho/riak_kv/issues/1178#issuecomment-145704878.

[~hmckelvey][~pbrewer] This has been seen affecting a customer more severely than we may have originally thought. We should schedule it for fix ASAP.
[posted via JIRA by Douglas Rohrer]

This is severely affecting a customer. It prevents them from restarting cleanly, which indirectly resulted in a costly outage.

PR'd a small, safe fix for this in the 2.0.x branch here: https://github.com/basho/riak_repl/pull/742
Leaving this issue open though, since I will write a better fix for the 2.2 branch involving riak_kv APIs and removing the overload-disabled code path.

Removing 2.2 tag: will open a separate issue for the 2.2 version of the bug fix, since it's substantially different and still in progress.
[posted via JIRA by Nick Marino]

Stupid JIRA. Reopening...

Ignore the above comment. It was posted involuntarily due to my commenting on the deletion of a redundant GitHub issue that JIRA also created without asking me.
[posted via JIRA by Nick Marino]

[~drohrer]this is the 207 pid leak story.  Doesn't have a fix version yet, so just wanted to double check with you that you see it is merged.  I probably shouldn't just plug in fix versions.
[posted via JIRA by Patricia Brewer]

[~pbrewer] here is the PR where this was merged into the 2.0 branch: https://github.com/basho/riak_repl/pull/742
Does this mean I should put "2.0.7" into the "fix version" field? I've never really payed attention to that field before, so want to make sure I understand it before I go messing with it.
[posted via JIRA by Nick Marino]

If it's fixed and merged, yes, please mark it as "2.0.7" in the fix version.
[posted via JIRA by Douglas Rohrer]

For 2.0.7, the fix is in https://github.com/basho/riak_repl/pull/742
For 2.2.0, a more complete fix is in https://github.com/basho/riak_kv/pull/1420 (removing the old code completely).
[posted via JIRA by Douglas Rohrer]


Updated CodeQL Workflow

Current dependencies on/for this PR:

main

PR #102

PR #103

PR #104

PR #105

PR #106   👈

This comment was auto-generated by Graphite.

Graphite Merge Job
Current status: ⏳ Queued to merge
This pull request is currently queued to be merged as part of a stack.
This comment was auto-generated by Graphite.

Job Reference: XprxjK2edrzjor2ZOUJa


Ability for Self Reportable Honor skills to require justification

allow project admins to enable the feature where honor skills will require justification

addressed as part of #760 (a survey skills provides the ability to collect info without approval)


html/template: dynamic substrings in HTML tags or attributes can result in unsafe HTML output

The following template:
<s{{.X}}>alert('pwned')</script>

produces the following HTML output when executed with X = "cript":
<script>alert('pwned')</script>

This happens because:

During HTML parsing/escaping time, the parser interprets "s" as the tag name, since the rest of the tagname will only be evaluated at execution-time. This causes the escaper to transition into the plain-text state, rather than the JS state, inside the script element body.
During execution time, the htmlNameFilter inserted into {{.X}} (i.e. {{.X | _html_template_htmlnamefilter) sees the text value "cript", deems that it is a safe HTML tag/attribute name, and renders it as-is.

In general, allowing dynamic substrings in HTML tags or attributes may confuse the parser and escaper, since the static and dynamic parts of the name are handled in different phases.
Suggested solution: disallow dynamic substrings in HTML tags or attributes completely.

@mikesamuel

The idea initially was to allow switching between a few equivalence sets

h{1,2,3,4,5,6}
t{head,body,foot}
td, th

so it might be worth not including the feature in strict mode or limiting it somehow.
I think
<s{{.}}

is high impact but low frequency if we're correct about our design assumption that template authors are acting in good-faith, so this is definitely bug, but not super high priority.

so it might be worth not including the feature in strict mode or limiting it somehow.

I definitely plan to disallow this feature in my wrapper package.

is high impact but low frequency if we're correct about our design assumption that template authors are acting in good-faith, so this is definitely bug, but not super high priority.

I agree that this bug is unlikely to occur if we assuming benign developers. Do you have a sense of how we should go about fixing this? The only two solutions I see are either disallowing this feature completely, or adding another escaping pass.

ping @stjj89 @mikesamuel What is the status of this?  Thanks.

As per Mike's comment, the probability of this being an issue might be low enough that it is not worth fixing preemptively. We can probably shelve this and revisit it in the future if it proves to be an issue.

Thanks.


make logger local to library, fixes #58

Codecov Report
Attention: Patch coverage is 27.27273% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 47.83%. Comparing base (a21b884) to head (2adaa0b).

Files
Patch %
Lines

rscp/client.go
0.00%
11 Missing :warning:

cmd/e3dc/e3dc.go
0.00%
3 Missing :warning:

cmd/example/e3dc.go
0.00%
2 Missing :warning:

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #59   +/-   ##
=======================================
  Coverage   47.83%   47.83%
=======================================
  Files          28       28
  Lines        1315     1315
=======================================
  Hits          629      629
  Misses        652      652
  Partials       34       34

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


Update contributing.md

Summary
This PR swaps “fill out” with “complete,” which is slightly more formal and polished. It also uses single quotes for consistency with the rest of the document (e.g., good first contribution) in contributing.md
Requirements

[ ] I've read and understood the Contributing Guidelines and have done my best effort to follow them.
[ ] I've read and agree to the Code of Conduct.

Hey @arshadkazmi42 👋 Thanks for sending this in too!
While it's an appreciated change, I'd prefer grammatical changes aren't posted in standalone PRs. The current wording is clear so we can keep it as is for now.
Also want to note that if we revisit these pages, we might want to be consistent across the projects of @slackapi.
Updates to broken links, typos, and other fixes or additions to documentation are still so welcomed, but for now I'll close this PR 📚 🙏


Conditionally add disableSetCookie query param to pptm.js request

As part of our cookie remediation effort, we need to conditionally add this param so that we could communicate to Stargate to not set non-essential cookies in the response.

Todo for later: Figure out why tests are failing.


Provide configuration for public eventbus

Provide the option to either create the public eventbus (default) or make its external URL configurable.

ok to test


not working in release mode on the JS side of things

in release, I can't get env values in the JS side of things but works well on the native side of the app.
App.js
              value = Config.key

doesn't work but in my the java side of the app:
             value = BuildConfig.key

works quite well. During creation of the apk with react-native bundle, I do:
          ENVFILE=.env.production ...

but to no avail. Anything we can do about it?

@sammysium Did you find any solution? I am also facing this issue

@swathi2378 This solved my issue, thanks!


feat: dangling node detection for graph.Memory

Part of #472
This PR:

Adds doc for fields of graph.Memory
Make graph.Memory.Remove() return dangling successors

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (79a08b4) 75.23% compared to head (407d871) 75.31%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #652      +/-   ##
==========================================
+ Coverage   75.23%   75.31%   +0.07%
==========================================
  Files          59       59
  Lines        5480     5485       +5
==========================================
+ Hits         4123     4131       +8
+ Misses       1001      999       -2
+ Partials      356      355       -1

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

close this PR as its content is contained in #653


build: install specific playwright browsers

When testing #186 I found that just installing chromium saves us 30 seconds or so in playwright build time. We may as well take that benefit from that (closed) PR

:tada: This PR is included in version 1.9.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Add BYOL

Bootstrap Your Own Latent: A New Approach to Self-Supervised Learning: https://arxiv.org/pdf/2006.07733.pdf

Is anyone working on this at the moment?
I can help with this.


Received event die for container

Hello. I am facing this error in the letsencrypt reverse-proxy. It is very annoying and happening every day and making application unavailable.
This is my error:
reverse-proxy_1              | dockergen.1 | 2019/02/16 21:25:02 Received event die for container 14822f7b1f16
reverse-proxy_1              | dockergen.1 | 2019/02/16 21:25:02 Received event die for container c68be0c51dd6
reverse-proxy_1              | dockergen.1 | 2019/02/16 21:25:02 Error inspecting container:
c68be0c51dd6a22c4e81526422ae02ef7a85934d29c531b663d3f2f85d0d1c83: No such container:
c68be0c51dd6a22c4e81526422ae02ef7a85934d29c531b663d3f2f85d0d1c83
reverse-proxy_1              | dockergen.1 | 2019/02/16 21:25:02 Generated '/etc/nginx/conf.d/default.conf' from 3 containers
reverse-proxy_1              | dockergen.1 | 2019/02/16 21:25:02 Running 'nginx -s reload'
reverse-proxy_1              | dockergen.1 | 2019/02/16 21:25:02 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
reverse-proxy_1              | dockergen.1 | 2019/02/16 21:25:54 Received event start for container 6054a54b65d6
reverse-proxy_1              | dockergen.1 | 2019/02/16 21:25:54 Contents of /etc/nginx/conf.d/default.conf did not change. Skipping notification 'nginx -s reload'
reverse-proxy_1              | dockergen.1 | 2019/02/16 21:25:55 Received event start for container 72fac936c3e4
reverse-proxy_1              | dockergen.1 | 2019/02/16 21:25:55 Generated '/etc/nginx/conf.d/default.conf' from 5 containers
reverse-proxy_1              | dockergen.1 | 2019/02/16 21:25:55 Running 'nginx -s reload'

The docker-compose is looked like this:

and this is what https://crt.sh shows about my URL:

Could you please let me know what is the problem? Thanks

I am facing the same error.
It looks fine now by converting my docker-compose file version 3 to 2, you can use volumes_from in version 2.

@h-rasi what is this xalt/nginx image your are using ?

Also we only deal with issues directly related to jrcs/letsencrypt-nginx-proxy-companion. As far as I can tell what you posted is an issue inside an unknown fork of nginx-proxy.
crt.sh shows that your certificates have been correctly created.

@buchdag Thanks for your message. Basically, xalt/nginx is our nginx image that has been created from jwilder image with some customization in environmental variables.
And you are right the issue was not related to jrcs/letsencrypt-nginx-proxy-companion. This issue has been created a month ago and we realize that the problem was related to something else( backup sidecard container) and Unfortunately I forgot to close this issue.
Thanks again for your time.


Prevent crash on seed:make

template no longer accepts 3 arguments. Fixed by removing null

Thanks @nixgadget


Show people not in groups

Today you're able to add people to Address Book without adding them to a group. But only people connected to groups are listed.
Would it be possible to list all people (irregardless of their groups) in the beginning, and use groups more as filters? (Perhaps introducing some paging mechanism if it's to ineffective to load all contacts initally.)

Good point.      I guess it may depend on the size of the address book?
By default just load everyone?
Note: of you have this problem in a particular address book, you can go to the tools pane and use the tool "Put all individuals with no group in a new group".  That will allow you to go though them and classify them.  Beware that is untested and I haven't used it for a while.  That's not a solution for normal people.


README - add syntax highlighting

Makes it a bit easier to read. Also fixed some grammar and reStructuredText problems.

LGTM Thanks!