Basic implementation of "client to server" ActivityPub protocol

Note on current state (as of 2020-05-24)
Pleroma
Minimal "client to server" #ActivityPub implementation is available. It is tested at https://queer.hacktivis.me/AndStatus (that site has the latest Pleroma builds... some requests work at other Pleroma instances also!) and can:

authenticate using OAuth 2.0, read the Actor's profile...
read timelines, including notes with attached images;
post notes, including attached images.

Latest #AndStatus version is here: https://github.com/andstatus/andstatus/issues/456
All critical Pleroma problems fixed as I test developer's builds at https://queer.hacktivis.me/ , so "Basic ActivityPub C2S implementation" could be considered completed.
Mastodon
Mastodon (not AndStatus!) doesn't give you enough features to switch client connection to ActivityPub simply because Home timeline and posting via ActivityPub connection is not supported yet (corresponding pages give 404 Not found error).
But you can see your authenticated Actor's own posts on Mastodon servers and navigate to other Actors and their posts via them (you can see profiles of other Actors and see their posts...). You can even play with Mastodon as an "ActivityPub" type Social network in AndStatus today (I implemented a hack to log into Mastodon... not ActivityPub way unfortunately...)! But prepare to see empty Home timeline (due to above mentioned deficiency) and to be read-only there for now. Switch to "Sent" timeline and see your Actor's posts, see other actors and their posts similarly...
These new Mastodon improvements make me very optimistic about the future of ActivityPub in the client apps across all server platforms.
Description
As defined at https://www.w3.org/TR/activitypub/ , ActivityPub provides two layers:

A server to server federation protocol (so decentralized websites can share information)
A client to server protocol (so users, including real-world users, bots, and other automated processes, can communicate with ActivityPub using their accounts on servers, from a phone or desktop or web application or whatever)

The "ActivityPub test suite" (worked in 2018-2019... see on ActivityPub testing here) site contained a test suite that checked basic features that are required for a client app to implement #ActivityPub.
Below is a list of corresponding steps/features (for the start, copied from that site), which we are implementing in AndStatus, together with their implementation status:
AndStatus UI changes:

[x] Add "ActivityPub" type of Social network.

Client: Basic submission

[x] MUST Client discovers the URL of a user's outbox from their profile
[x] MUST Client submits activity by sending an HTTP post request to the outbox URL with the Content-Type of application/ld+json; profile="https://www.w3.org/ns/activitystreams"
[x] MUST Client submission request body is either a single Activity or a single non-Activity Object
[x] Client submission request is authenticated with the credentials of the user to whom the outbox belongs (this could be using an OAuth 2.0 bearer token or something else)
Currently we reused OAuth 2.0 implementation that works in AndStatus for Mastodon.

Client: Required properties

[x] MUST Client provides the object property when submitting the following activity types to an outbox: Create, Update, Delete, Follow, Add, Remove, Like, Block, Undo.
[ ] MUST Client provides the target property when submitting the following activity types to an outbox: Add, Remove.

Client: Add targets on reply
Reply to a post with multiple recipients.

[x] SHOULD Before submitting a new activity or object, Client infers appropriate target audience by recursively looking at certain properties (e.g. inReplyTo, See Section 7), and adds these targets to the new submission's audience. (The client suggests audience targeting based on participants in the referenced thread)
[x] SHOULD The client also limits depth of recursion used to gather targeting.

Client: Accept header on object retrieval
Trigger the client to retrieve some remote object.

[x] MUST When retrieving objects, Client specifies an Accept header with the application/ld+json; profile="https://www.w3.org/ns/activitystreams" media type.

You will need to use the Mastodon API to obtain client secrets for OAuth.

Ugh wait. What's the point of having a C2S standard if OAuth registration isn't even part of it? How was it intended to work? 🤔

Yes, ActivityPub refers to OAuth but doesn't mention the "registration" word explicitly.

ActivityPub specification refers to OAuth 2.0 and OAuth 2.0 bearer tokens as a way to authenticate client to server interactions (see descriptions of corresponding endpoints in the "Actor objects" section https://www.w3.org/TR/activitypub/#actor-objects
In the (non-normative) "B.1 Authentication and Authorization" section the specification also refers to the Social Web Community Group Authentication and Authorization best practices report ( https://www.w3.org/wiki/SocialCG/ActivityPub/Authentication_Authorization ), which in a "Client to Server" section says:

ActivityPub clients authenticate against a server using OAuth 2.0 bearer tokens. ...Client IDs may be acquired out of band for some servers. They may also be acquired using RFC7591.

The RFC7591 ( https://tools.ietf.org/html/rfc7591 ) is "OAuth 2.0 Dynamic Client Registration Protocol".
So OAuth Client Registration is at least a part of the specification's best practices :-)
We do have working OAuth 1.0 and Dynamic Client registration for a federated network, that's very close to ActivityPub from a Client app point of view ( pump.io https://github.com/pump-io/pump.io/blob/master/API.md ). Plus we do have OAuth 2.0 e.g. in Mastodon. So I think that we just need to go only one step further to implement OAuth 2.0 + Dynamic Client registration + "whoami" point in order to have a "bootstrap" for the "Client to Server interactions", which are actually part of the ActivityPub spec.
This is how it will work.
?!

Have to say, that this is a bit strange to use OAuth in federated network. Because it's a standard which allows to authorize using some centralized authority, and fediverse do not have one

@yvolk
my current Pleroma tree has /api/ap/whoami for this purpose.  I will deploy it on pleroma.site in a few hours.  will this work for you?

@yvolk
my current Pleroma tree has /api/ap/whoami for this purpose. I will deploy it on pleroma.site in a few hours. will this work for you?

Yes, will test further and let you know. Thank you.

I deployed that endpoint on pleroma.site.

The AP C2S whoami endpoint which allows for mapping OAuth credentials to an actor endpoint is now in Pleroma upstream.
oauthAuthorizationEndpoint and oauthTokenEndpoint will be added to actors too.

The AP C2S whoami endpoint which allows for mapping OAuth credentials to an actor endpoint is now in Pleroma upstream.
oauthAuthorizationEndpoint and oauthTokenEndpoint will be added to actors too.
@kaniini Frankly I don't understand, why these two endpoints may be needed, if I get them after OAuth authentication procedure.
What worries me in our growing solution, are URLs of the two quite voluntary/hardcoded endpoints:

Client registration at https://pleroma.site/api/v1/apps
whoami endpoint at https://pleroma.site/api/ap/whoami
Both endpoints are unknown to a client application, visiting this host.

I think that

we need to use more "standard" URL for the Client Registration, e.g.
https://pleroma.site/register (just like in examples, although non-normative, in https://tools.ietf.org/html/rfc7591
Whoami endpoint URL should be added as a separate property to a metadata, returned by a server during Client registration
?!

[2019-02-06 22:23:57] Yuri Volkov:

The AP C2S whoami endpoint which allows for mapping OAuth credentials to an actor endpoint is now in Pleroma upstream.
oauthAuthorizationEndpoint and oauthTokenEndpoint will be added to actors too.
@kaniini Frankly I don't understand, why these two endpoints may be needed, if I get them after OAuth authentication procedure.

An actor is public data, it would allow to give https://pleroma.site/users/kaniini (actor IRI) or<EMAIL_ADDRESS>(actor WebFinger) to register.
Which have the nice addition of giving username+instance in one shot.

What worries me in our growing solution, are URLs of the two quite voluntary/hardcoded endpoints:

Client registration at https://pleroma.site/api/v1/apps
whoami endpoint at https://pleroma.site/api/ap/whoami
Both endpoints are unknown to a client application, visiting this host.

I think that

we need to use more "standard" URL for the Client Registration, e.g.
https://pleroma.site/register (just like in examples, although non-normative, in https://tools.ietf.org/html/rfc7591
Whoami endpoint URL should be added as a separate property to a metadata, returned by a server during Client registration
?!

Why would the mastodon one not become the standard one for client registeration? It’s basically the de-facto one.
But maybe there should be something in nodeinfo (but that’s not strictly ActivityPub) about which authentification is supported on the server.

@yvolk

Frankly I don't understand, why these two endpoints may be needed, if I get them after OAuth authentication procedure.

Why it is so important to perform client registration first? Client could start with fetching user profile using webfinger. It is de-facto standard for activitypub servers and is used to fetch user profiles, when user from one server searches for user from another server
<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>User profile MAY contain

oauthAuthorizationEndpoint and oauthTokenEndpoint will be added to actors too.
and it could be extended with attribute which contains url for dynamic registration. And there will be no need to standardize endpoints names

Still, this discussion looks like trying to stretch owl over the globe. OAuth is designed for cases when there is certain centralized server (which defines endpoints due to OAuth spec), not for chaotic federation

[2019-02-07 19:39:05] Mykhailo Kushchenko:

User profile MAY contain

oauthAuthorizationEndpoint and oauthTokenEndpoint will be added to actors too.
and it could be extended with attribute which contains url for dynamic registration. And there will be no need to standardize endpoints names

Still, this discussion looks like trying to stretch owl over the globe. OAuth is designed for cases when there is certain centralized server (which defines endpoints due to OAuth spec), not for chaotic federation

Please do not make a fictionnal argument: OAuth is there is many (all deployed ones?) fediverse implementations (StatusNet, GnuSocial, Friendica, Mastodon, Pleroma, …) and other authentification methods have been:

(HTTP) Basic Auth: which I would regard as quite bad when long-lived because you have to keep the password in plaintext
OpenID: which is even worse than OAuth at centralisation and it completely leaks access to a provider
IndieAuth?: which is basically a wrapper and involves way too many parties to work (extra: OpenPGP auth is/was broken for myself, probably because of Elliptic Curves)

Why it is so important to perform client registration first? Client could start with fetching user profile using webfinger. It is de-facto standard for activitypub servers and is used to fetch user profiles, when user from one server searches for user from another server
<EMAIL_ADDRESS>...

@autogestion This is just another way to discover a user profile. But not an ActivityPub way. I don't see any links to such a way in ActivityPub docs...

An actor is public data, it would allow to give https://pleroma.site/users/kaniini (actor IRI) or<EMAIL_ADDRESS>(actor WebFinger) to register. Which have the nice addition of giving username+instance in one shot.

@lanodan The problem is that even if I know my user's webFingerId<EMAIL_ADDRESS>I don't know URI of the user's (Actor's) profile at the "pleroma.site" host.
@kaniini I succeeded to create an account in AndStatus via ActivityPub interface, read the user's profile via "whoami" endpoint, discover (URLs of) all endpoints and request the "inbox" (Home) timeline.
Now I need to adapt source code to parse the timeline.

@kaniini BTW, it looks like the endpoint in the user's profile
""sharedInbox": "https://pleroma.site/inbox""
leads to nowhere (I received HTML page instead of JSON timeline...). Could you look at this?

[2019-02-10 10:19:36] Yuri Volkov:

An actor is public data, it would allow to give https://pleroma.site/users/kaniini (actor IRI) or<EMAIL_ADDRESS>(actor WebFinger) to register. Which have the nice addition of giving username+instance in one shot.

@lanodan The problem is that even if I know my user's webFingerId<EMAIL_ADDRESS>I don't know URI of the user's (Actor's) profile at the "pleroma.site" host.
You actually do:
curl -s<EMAIL_ADDRESS>| jq '.links[] | select( .type == "application/activity+json" )'

{
  "type": "application/activity+json",
  "rel": "self",
  "href": "https://pleroma.site/users/kaniini"
}

@yvolk

But not an ActivityPub way. I don't see any links to such a way in ActivityPub docs...
It has one mention https://www.w3.org/wiki/ActivityPub_and_WebFinger which leads to this thread w3c/activitypub#194 . And this is more like fediverse standard, it is also used by diaspora and other protocols

it looks like the endpoint in the user's profile ""sharedInbox": "https://pleroma.site/inbox""
It have to accept only POST requests from other servers. The idea of this endpoint, that if server have to deliver update to several users on one server, it could post it once in shared inbox, instead of posting several times to inbox of every target

@lanodan @autogestion Thank you for examples and links on usage of WebFinger protocol (defined in https://tools.ietf.org/html/rfc7033 ). Reading the thread https://github.com/w3c/activitypub/issues/194 I've got that WebFinger really could be used in a case we know WebFingerId of a User and need to discover his/her profile in ActivityPub, but not as a general way to discover users' profiles...
Unfortunately, WebFinger doesn't reduce a number of hardcoded endpoints in a case of ActivityPub account creation in a client application (e.g. in AndStatus): we still need URLs of "Client Registration" and "Whoami" endpoints.
So I've hardcoded the endpoints for now (thinking about introducing alternative URLs...) and now I'm moving forward in implementing most needed APIs.

it looks like the endpoint in the user's profile ""sharedInbox": "https://pleroma.site/inbox""

It have to accept only POST requests from other servers. The idea of this endpoint, that if server have to deliver update to several users on one server, it could post it once in shared inbox, instead of posting several times to inbox of every target

@autogestion  Not only. As ActivityPub spec says, this endpoint also serves another purpose: "Some servers would also like to display a list of all messages posted publicly to the "known network"" and "sharedInbox endpoints SHOULD also be publicly readable OrderedCollection objects containing objects addressed to the Public special collection. Reading from the sharedInbox endpoint MUST NOT present objects which are not addressed to the Public endpoint."
So this endpoint may provide a publicly readable timeline also.
@kaniini

to clarify stuff on Kroeg (which has a full C2S and S2S impl of ActivityPub):

The endpoints can be set up to contain the OAuth urls, and i am going to add me into the token response for OAuth (ala IndieAuth), since i will never implement /api/whoami.
the sharedInbox endpoint is readable, and indeed returns a list of messages posted to that sharedInbox, so like a type of 'global timeline' as far as that concept exists in Kroeg.
please test with Kroeg (i will provide an account if needed) since it does many things that are 100% legal inside ActivityPub but that many things just don't like.
there's a proxyUrl endpoint that can be used to retrieve remote objects, which will ensure proper handling of things like inReplyTo a private object that hasn't been inlined

i tried adding a Kroeg account (using the latest play store version) and it just ended up not doing anything after requesting /api/whoami ("MyAccount.Builder: Couldn't set the Username to: Empty")

@kaniini While implementing timeline parsing I found two bugs already in Pleroma, please see https://git.pleroma.social/pleroma/pleroma/issues

@puckipedia "whoami" endpoint is really important to make sure that a User successfully "logged into" his/her own account AND to discover all the User's endpoints.
I looked at https://indieauth.spec.indieweb.org/#authentication - it assumes that a User will type (copy/paste) his profile URL in order to log in. Not very user friendly :-)
Getting the URL from "me" property is good, I like it ( https://indieauth.spec.indieweb.org/#access-token-response )
Please provide me with testing account at your server, I will test it also.
BTW, I will create next AndStatus build as soon as I will succeed to post my first Note via ActivityPub C2S API.

https://git.pleroma.social/pleroma/pleroma/merge_requests/821 adds the two AP endpoints for OAuth, as well as litepub:oauthRegistrationEndpoint.
I can add a litepub:oauthVerifyEndpoint which would be your whoami endpoint, but it still seems kinda silly to me.  I don't know of any situation where you would be given oauth credentials for an account that is different than that you started the flow with.

I can add a litepub:oauthVerifyEndpoint which would be your whoami endpoint, but it still seems kinda silly to me. I don't know of any situation where you would be given oauth credentials for an account that is different than that you started the flow with.

@kaniini  Adding "whoami" endpoint to an Actor's profile seems silly to me also :-) Please add a link to it as "me" property of the OAuth access token response just  like shown in https://indieauth.spec.indieweb.org/#access-token-response and as @puckipedia suggested.
Please note the the whoami endpoint serves very important purpose, which the users profile doesn't: successful access to it really proves that a client application is correctly authenticated by a server. Accessing this endpoint after initial account creation in a client application allows a User to check if connection to a server works now.

Yeah I like the idea of just returning who the actor is in the OAuth response.  I'll do that in a separate MR.

there is one more thread about profile url discovering w3c/activitypub#20 where they talk about "follow your nose" approach. The idea, as I get it, is that profile could be discovered by next pattern  -  https + domain + @ + username. Mastodon already support this schema ( https://mastodon.social/@dansup ). Looks like it's proper ActivityPub way, instead of tweaking OAuth

there is one more thread about profile url discovering w3c/activitypub#20 where they talk about "follow your nose" approach. The idea, as I get it, is that profile could be discovered by next pattern - https + domain + @ + username. Mastodon already support this schema ( https://mastodon.social/@dansup ). Looks like it's proper ActivityPub way, instead of tweaking OAuth

@autogestion I also read that thread, and as I wrote earlier in https://github.com/andstatus/andstatus/issues/499#issuecomment-462412681 I've got that WebFinger really could be used in a case we know WebFingerId of a User and need to discover his/her profile in ActivityPub, but not as a general way to discover users' profiles.
ActivityPub operated with Actor IDs, which aren't necessarily WebfingerIDs. So usage of this way is limited anyway.
As a side note: During analysis of messages from different networks (different instances of GNU Social and Mastodon...) using AndStatus app I found out that "UserName @ Host" is not always exactly "Webfinger ID" is the sense of the unique identifier: UserName is a "case sensitive name" and may be e.g. "AndStatus" (i.e. "andstatus" means another user...). Whereas "Webfinger ID" have to be case insensitive: I have to convert it to the lowercase in order to successfully identify the same Actor (user) in different networks...

@autogestion In short: assuming that

A server provides in the OAuth access token response the "me" property with "URL of my profile"
looks to me a far more natural ActivityPub implementation than:
A server interprets a request with "https + domain + @ + username" query as a request for the URL of a profile for an Actor with "preferredUsername" (in ActivityPub terminology) = provided "username" and with "id" that could be dereferenced to the server's host...

https://hostname/@:username is awfully non-standard (even de-facto, it’s only Mastodon) and isn’t ActivityPub at all as on Mastodon the actor IRI is https://hostname/users/:username, the /@:username route is for the profile web page.

@kaniini @autogestion I made the simplest implementation of #ActivityPub C2S protocol in #AndStatus, allowing me to log into pleroma.site, read home timeline a get other user's info (i.e. read the Actor's profile based on his "id").
But I've got an error response from pleroma.site server on an attempt to send a Note, so I created another bug report in pleroma issues tracker: https://git.pleroma.social/pleroma/pleroma/issues/650
Alpha build of AndStatus is attached to this comment: https://github.com/andstatus/andstatus/issues/499#issue-389014088 , source code is available in the repository.

The error is that you're sending to inbox instead of outbox.  Not a pleroma bug just a mistake :)

@kaniini It's not so simple, please see my response: https://git.pleroma.social/pleroma/pleroma/issues/650#note_17234

@kaniini Thank you for investigation. In #AndStatus v.47.02-alpha (attached to the first post of this thread) I can successfully post a Note to pleroma.site via #ActivityPub C2S API and see the Note published in AndStatus.
The latest page of inbox and outbox timelines is loaded successfully, (I didn't implement paged loading yet...).

@kaniini As we discussed earlier here it would be good to add "whoami" ("me") endpoint to an OAuth response in order not to hardcode this endpoint.
As I see, pleroma.site doesn't send this endpoint yet: I checked both Client registration response (preferred place for the endpoint that is the same for all accounts)
and Access token response.
At least I can easily extract that endpoint from both places.
Please implement!

https://git.pleroma.social/pleroma/pleroma/merge_requests/942 adds that response.

@kaniini Thank you, I implemented corresponding change in AndStatus, waiting for your change to appear live on the pleroma.site

This change has gone live on pleroma.site.

@kaniini Thank you, the "me" property works! AndStatus v.47.06 (released yesterday) uses this already.
As another step forward I raised the issue: https://git.pleroma.social/pleroma/pleroma/issues/741 "ActivityPub C2S: Request to the URL of the conversation's ID returns blank HTML page instead of JSON conversation".
Please implement.

@kanini I raised another issue to pleroma: "ActivityPub C2S: No way to request newer page of the CollectionPage" that is really a blocker even for the "Basic" ActivityPub C2S implementation: https://git.pleroma.social/pleroma/pleroma/issues/751
Please implement.

Some time ago posting to pleroma.site stopped working properly due to changes at Pleroma side. I fixed this in AndStatus v.49.00, download from #456
The only critical thing to implement is posting attached images. @kaniini How to do this via "ActivityPub C2S"?

I create the issue in Pleroma on uploading images: https://git.pleroma.social/pleroma/pleroma/issues/1171

Copied from my Mastodon posts...

I believe the workflow with discovery should be:

The user inputs their ID
The client retrieves the actor (by way of webfinger if it's in user@domain form)
The client uses the oauthTokenEndpoint and oauthAuthorizationEndpoint from the endpoints property of the actor, if present, to obtain tokens and grants (fallback to Masto API endpoints)

The token endpoint should be retrieved from the actor for each account before registering the client, even if the client install has registered another account on the same domain, in order to support per client instance workflows. When the server operator is providing stateless authorization, per client instance support is necessary to allow users to approve scopes individually

In response to "Follow your nose":

The actor document is the SDF. I'm just taking the pragmatic approach of adding the relevant elements from the ActivityPub spec to the current implementation. So content negotiation on the actor id is the preferred method for retrieving the actor document and the actor is where the scent begins for discovering other endpoints

The AP Actor document isn't a great service description, but it's the one we have
Finally, a more correct and coherent statement of what I was trying to say on https://banana.dog/web/statuses/102810770163813523 is that client_secret is not required in the registration response, but client_secret_expires is required if a client_secret is provided. At first I thought it was funny that the client didn't include the secret when making a grant request, but I see that the client_secret is only used when the client is changing its own information
My use case is porting games from play by email to play by AP, where players usually have a close relationship with someone developing a custom client. I'm also thinking of Epicyon, a more privacy focused AP implementation from another developer that would probably benefit if this workflow were settled

@swift2plunder I'm glad to hear about another server side implementation. Please let me know when I can create an account at your server and start testing, improving and extending implementation in AndStatus.

I created the issue in Pleroma on uploading images: https://git.pleroma.social/pleroma/pleroma/issues/1171

@yvolk : I case you didn't get the notification on pleroma's gitlab, I have implemented it about a week ago: https://git.pleroma.social/pleroma/pleroma/merge_requests/1706

@lanodan Thank you, the ball is on my side now :-)
Please don't forget to implement/fix https://git.pleroma.social/pleroma/pleroma/issues/751 also "No way to request newer page of the Collection" :-)

@lanodan I've looked into the change https://git.pleroma.social/pleroma/pleroma/merge_requests/1706/diffs and checked uptated "whoami" response at https://pleroma.site/api/whoami
And I see that the change is not present at the https://pleroma.site :-(
(there is no "uploadMedia" endpoint there)
Please deploy your change so I could actually test while developing client code
?!

In v.51.02 posting and downloading multiple attachments is implemented. Tested at https://queer.hacktivis.me/AndStatus?tab=statuses thanks to @lanodan
Now I can successfully post and download posted note with attachments (tried one and two so far...), but these posts aren't visible in the Web site's timeline yet...

See current state of this implementation in the first comment of this thread.
The only feature that I didn't implement yet: Add and Remove actions, applicable e.g. to server-side collections (e.g. "Bookmarks". Unfortunately, no known ActivityPub C2S server implemented this yet.

Further discussion regarding proper OAuth implementation for ActivityPub C2S is here: https://github.com/andstatus/andstatus/issues/528 (April 2021)


Add "latest" tag to Docker extensions

Tell us about your request
Please, add a "latest" tag to every Docker extension in Docker Hub.
Which service(s) is this request for?
Docker Desktop
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
Some Docker's Docker Desktop extensions (e.g. Disk Usage or Logs Explorer) have no a latest tag in Docker Hub, so to install the latest version from the console it is necessary to know it beforehand since a (e.g.) docker extension install docker/logs-explorer-extension -f will fail.
Are you currently working around the issue?
We're using Ansbile to install Docker Desktop, so we came up with this solution:
- shell: 'docker extension install {{ item }}:{{ version }} -f'
  vars:
    json: "{{ lookup('url', 'https://hub.docker.com/v2/repositories/{{ item }}/tags') | from_json }}"
    version: '{{ json.results[0].name }}'
  loop:
    - docker/disk-usage-extension
    - docker/logs-explorer-extension
  become: false

Hi @nuno-andre thanks for the idea!
The pain point here is to know the latest available semver tag of the extension. I wonder if it wouldn't be better for the CLI to retrieve the latest version if none is provided and there is no latest tag.

Hi @benja-M-1!
Yeah, that would be great! Searching for the newest version for an OS/arch in the absence of a latest tag (or a explicit version in the command argument) would be the ultimate solution.
I'm going to update the issue to reflect your approach.


Sytax hilighting not support objective-c

Sytax hilighting not support objective-c

Jekyll uses Pygments as syntax highlighter, so Objective-C should be supported.
Are you using the jekyll code highlighting syntax?


flutter doctor implies I need both iOS and Android toolchains installed to just try Flutter

Flutter doctor is amazing! But, for the first hour, it may be (incorrectly) suggesting that you need both iOS and Android toolchains installed just to try Flutter.
See anecdote here: https://twitter.com/clarklab/status/998613583599669250

A heading that tells which tools to install would be good. Something like this
For Android development install:
• ...
For iOS development install:
• ...

adding @mit-mit

A heading that tells which tools to install would be good

The current Android and iOS headings do (attempt) to explain this:
Android toolchain - develop for Android devices / iOS toolchain - develop for iOS devices
Is the core issue that this language isn't strong enough, or that it's easily missed among all the other text?

I think we've trained (and continue to train) developers that a successful installation is one where the output of flutter doctor is fully checked.
In https://flutter.io/setup-windows/, for instance, we tell you:

run the following command to see if there are any dependencies you need to install to complete the setup

There's no indication that one or the other is sufficient to start developing, either in the tool or the accompanying docs. Instead we give you an [x] which implies failure/incompletion.
It might be viable to use the verbose mode for non-essential dependencies, or to add a line to the output of flutter doctor if the minimum dependencies are satisfied, along the lines of:

SUCCESS: you have everything you need to start developing in Flutter. Check the verbose output to see

But how do we determine what is 'essential' vs 'non-essential'. The category of deps we are checking here for is 'essential' to a developer that wants to develop for that platform, but 'non-essential' to the one that doesn't. So we would need some way of asking what platform they are interested in, which get's complicated.
Alternatively, and probably more straightforward we could do what we do for IDEs: omit the checks until "something" is installed for that particular platform (for example, if a developer doesn't have anything from the Android SDK installed, then assume they are not interested in Android, and don't check for anything).
cc @devoncarew ideas?


Is there any quick and easy way to run through all these benchmarks?

Unfortunately no - there's another repo, https://github.com/adamw/mqperf-chef, where I have the basic chef scripts for setting up opsworks servers. But as each messaging provider has a different setup (sometimes they provide docker imags, sometimes not), it's a case-by-case thing. And I only set up each cluster once so I didn't automate this step.


Windows Anonio needs to be restarted daily.

windows version of Anonio wallet changes from 'READY' to 'ERROR' on a daily basis... let me know if there's info needed to troubleshoot?  v7.0.2-rc1

Anonio has undergone significant updates recently and a new release is in the pipeline - this includes a completely new way to start and stop the embedded daemon which has certainly proved to be very reliable in testing

will move to Anonio on Linux to see if more stable...


follow issue not available in TFS

When will this feature be available for on-premise TFS ?

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: cd3da932-a8f8-f0b9-668d-0eb498df93b6
Version Independent ID: 51e6cad0-1737-017a-9ce1-8c6c0090fc56
Content: Follow wiki page, get notifications - Azure DevOps
Content Source: docs/project/wiki/follow-notifications-wiki-pages.md
Product: devops
Technology: devops-collab
GitHub Login: @chcomley
Microsoft Alias: chcomley

Hi @nadavsinai, Thanks for reaching out! This feature will be available with the Azure DevOps Server 2020 release. Thank you!


Add overview and open-in-colab link to the bigframes remote functions…

… + anthropic claude integration notebook
Preview the full notebook in my fork:
https://github.com/shobsi/bqtoclaude1/blob/main/Python_Notebook_Sample/BigFrames%2BClaude_Remote_Function.ipynb

looks good


Can set up sites to be excluded in chatGPTBox?

Hi, I'm looking for a new site to add to chatGPTBox.
Is it possible to set sites to be excluded from chatGPTBox?
For example, in my case, the layout of a site with the "news.yahoo.co.jp" domain is broken.
So I would like to exclude this domain from chatGPTBox, but I can't find the setting item.
Currently, I am using Stylus to set
#chatgptbox-container, .chatgptbox-container {
display: none !important;
}
As above, I only don't display the "news.yahoo.co.jp" domain....

Trial,
https://news.yahoo.co.jp/pickup/6465061
If you access this URL, you will see that the chatgptbox-container is displayed within the content on the left side, and the layout is broken.

set your custom site regex to solve that

Reply, thanks.
I specified the domain not to be applied in that settings screen and it worked fine!


Pressing page-up in code text-area results in unhandled excetion

When the code text area is active, when pressing page-up, I'm getting an unhandled IndexError: list index out of range
Using the latest main branch.

Thanks for the report - I'll take a look

Pretty obvious what's going on here from the trace. Going to move this to the upstream repo and get a fix out asap.


encoding of Mealy machine states

The states of the synthesized Mealy machines look a bit odd in the examples as of the head of master branch:
>>> print ctrl.states
States:
[u'0x9980E0',
 u'0x997D30',
 u'0x997F30',
 u'0x997F70',
 u'0x997C60',
 u'0x9978D0',
 'Sinit',
 u'0x997DC0',
 u'0x997E00',
 u'0x998210',
 u'0x9980A0',
 u'0x997B60']

Is this an intentional change or is this something to do with my setup?

If you are using gr1c, then they appear normal, because it gives hexadecimal values to states, as in the example shown in its documentation.

I was just confused seeing different results in TuLiP in two different machines. Didn't notice this was due to different versions of gr1c installed on these machines. This seems to happen with gr1c 0.9.0 but not with gr1c 0.10.2.

Hexadecimal names strategy nodes result also with gr1c == 0.11.0.


StorkeAlign.outside looks different compared to figma's outside option

Use case
Hi! I found something awkward using StrokeAlign.outside and BorderRadius.circular together.
 Container(
  ...
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(12),
          border: Border.all(
            strokeAlign: StrokeAlign.outside,
            ...
          ),
        ),

As it shows below, rounded border with StrokeAlign.outside option doesn't look natural.
I believe any rounded border on everywhere (like normal websites or programs) would be using rounded border as figma does.

Proposal

I can draw two circles around the border, inside and outside of the box.
Their radius looks same in Flutter debug mode but I think they need to be different from each other to be natural.
If this feature already fixed or does not happen in release mode, please let me know. I'm using Flutter (Channel stable, 3.3.7)
Thanks for reading!

Can you try reproducing on master/beta? I think this was fixed. The API is also now called BorderSide.strokeAlignOutside. There were a few big changes that didn't make into the last stable.

@bernaferrari Thanks for reply. I found something very interesting, the error is gone while I didn't do anything special but quit and restart vscode. I didn't event fixed strokeAlign to strokeAlignOutside nor change flutter's branch.
This is my code... I'm using GetX and OllyTextButton is a custom button widget.
Widget _toiletTypeButton(ToiletType type) {
    return Obx(
      () => Expanded(
        child: OllyTextButton(
          selected: controller.type == type,
          onTap: () {
            controller.selectType(type);
            _scrollController.animateTo(Get.height, duration: const Duration(seconds: 1), curve: Curves.ease);
          },
          label: type.displayName,
        ),
      ),
    );
  }

// OllyTextButton: StatelessWidget

@override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () => onTap(),
      child: Container(
        width: fit == BoxFit.fill ? double.infinity : null,
        padding: _padding(),
        decoration: BoxDecoration(
          color: OllyColors.white,
          borderRadius: BorderRadius.circular(8),
          border: Border.all(
            color: selected ? selectedBorderColor : defaultBorderColor,
            width: selected ? selectedBorderWidth : defaultBorderWidth,
          ),
        ),
        child: Column(
          children: [
            _label(),
            const SizedBox(height: 4),
            _description(),
          ],
        ),
      ),
    );
  }

Your previous issue was probably related to lerp, something didn't finish.

Okay, I understand. I guess it occurs only in some cases... I remember this option worked normally in previous time.
Should I close this issue or not?

You should close, if it happens again reopen.

Okay, thanks for replies!


Post images

Hi,
thanks for sharing your code, looks really neat! I'm trying to do a lasagne implementation of your code and I was hoping you could post pictures of the images you got, so I can compare with mine. Thanks!

Hi and sure.
These are images from epoch 10, 100 and 200 training with CIFAR-10.
All inputs to the generator are randomly sampled each time.


Cannot parse stdout

I installed sqllite3 and the extension, and every time I update the cache, I got the below error:

And the column/table name autocompletion does not work. What could be the issues?
I did not see any error message in the output pane though.

I made a slight change in latest version (v0.0.54). https://github.com/kitta65/bq-extension-vscode/commit/31c054c724d65193fd91f4d52ce846c8fe2ea1ec
Can you tell me if your problem still exists?

Thank you for the response. But it's weird that the update cache command disappears after I installed the new version. Not sure if anything wrong from side though.


OpenSSL update to 1.1.1k

Library name: OpenSSL
New version number: 1.1.1k
Other information that may be useful (release notes, etc...)
Has some security improvements.

#16937


Adding the foreach* command

Would you actually mind making this pull request against [ispc/ispc][ispc] first? You can find this Vim plugin in the contrib/ of that repo. Link back to the PR so I can follow along.
I'd prefer to not diverge from the upstream repo too much, but if they show hesitancy to include this change upstream we can address that down the road.

https://github.com/ispc/ispc/pull/1189

Thanks!


add support for multiple templates to allow for addition of call for talks page

use front matter for parsing json to add support for md
and uopdate tests for this

That is the longest 😨 title ever

i agree with the yarn update i think i might draw up a doc/section in the readme about separating new dep and dep updates into separate prs


Windows GUI: Use Edge WebView2 for HTML/Graph view

Use Edge WebView2 for HTML and Graph view when available else fallback to IE.
This should work on Windows 7 to 11 both with and without Edge WebView2 Runtime installed.
Additional changes beyond this PR that are required to get WebView2 working:

Install EdgeView2 SDK 1.0.1054.31 by Microsoft from GetIt Package Manager

For more information: https://github.com/MediaArea/MediaInfo/pull/857#issuecomment-2143835197

@JeromeMartinez if you let me know where WebView2Loader.dll (both 32-bit and 64-bit) is located on the build farm after installing EdgeView2 SDK 1.0.1054.31 by Microsoft, I might be able to help update the installer and packaging scripts for implementing this.

Tried updating the installer and packaging scripts.
@JeromeMartinez Now on your side only need to do the following for this PR:

Install EdgeView2 SDK 1.0.1054.31 by Microsoft from GetIt Package Manager in C++ Builder on build farm
See if the build farm successfully produces a build with this PR

I can help check/test the installer and 7z when there is a dev snapshot for this PR.

Tested locally built installer with this PR. It works as expected on Windows 11 including the uninstallation.
Also tested on Windows 7 VM.
Without Edge WebView2 Runtime installed:

With Edge WebView2 Runtime installed:

@JeromeMartinez remember the bug in https://github.com/MediaArea/MediaInfo/pull/853#issuecomment-2141385021? This bug is more serious in Windows 7 where it pops up the following:

The good news is that with Edge WebView2 Runtime installed, this bug does not happen.

Now on your side only need to do the following for this PR:

@cjee21 sorry to be late on this one, but still on my radar, please be patient, ~10 days before we have more time.

Just realized Graph view is using HTML too so implemented WebView2 for that too. Tested.
Note: Graph view does not have dark mode.

Note: Graph view does not have dark mode.

True... HTML code is mixed in C++ code in https://github.com/MediaArea/MediaInfoLib/blob/master/Source/MediaInfo/Export/Export_Graph.cpp , we need to add an option to the library for indicating that we want a dark version...

Note: Graph view does not have dark mode.

True... HTML code is mixed in C++ code in https://github.com/MediaArea/MediaInfoLib/blob/master/Source/MediaInfo/Export/Export_Graph.cpp , we need to add an option to the library for indicating that we want a dark version...

Ideally, we should put all styles in all generated HTMLs in

Ideally, we should put all styles in all generated HTMLs in

Anyway, wait till you have more free time first then probably work on merging the 64-bit first since this WebViiew2 PR should be easy to re-base. I am aware your team needs time to deal with the 64-bit graph plugin as well. I did not think of the graph plugin previously since I do not use it usually.

True. Maybe better to do that and then hack in the GUI for selecting the right style dynamically.

Here is one possibility:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>MediaInfo</title>

General

    Complete name :
    D:\Audio_ID_720p_50fps_h264_514ch_192kbps_ac4.mp4

    Format :
    MPEG-4

...

It displays properly with auto theme switching on Edge and Firefox. Not tested on MediaInfo GUI yet.
For validator:

No idea what the colspan="3" are for. If those can be removed then we'll only have the language warning in validator.

For graph view:
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>MediaInfo</title>

...

and
...


remove unused cluster_local_instance param

Motivation
remove unused cluster_local_instance param

I think this fail is related to that mail thread that was going around this morning, I've rebased on Aiden's PR now.

@maleck13 this is passing now.

@vchepeli can you try this out with Phil. Testing the different scenarios IE using the 192 local address and using the wifi network address

@philbrookes LGTM, now it makes sense to remove it from installer script

@vchepeli yes, I had taken that out, but had to restore it for the Jenkins tests to pass. I guess there is something in Jenkins that cares about that param.
Are you still happy for this to be merged?

closing in favour of https://github.com/aerogear/mobile-core/pull/121


SWARM-542: Can't run main() from IDE when using only Gradle, not Maven

Motivation
When developing with gradle, it should be possible to work without the local maven repository.
Modifications
Detect when the IDE is using gradle. If gradle is used, respect the gradle cache format and use the gradle cache.
Result
The repository mavenLocal() isn't any more needed in the repository config.

[X] Have you followed the guidelines in our Contributing document?
[X] Have you created a JIRA and used it in the commit message?
[X] Have you checked to ensure there aren't other open Pull Requests for the same issue?
[X] Have you built the project locally prior to submission with mvn clean install?

Can one of the admins verify this patch?

Can one of the admins verify this patch?

test this please

test this please

ok to test


Test small changes still need to sign cla based on link config

Test small changes still need to sign cla based on link config

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.:x: contributor01 sign nowYou have signed the CLA already but the status is still pending? Let us recheck it.


ObjC: Should generate a custom method to allow efficient exchange of data with NSData.

Conceptually something like this:
class NSData  extends NSObject {
  factory Data.fromUint8List(Uint8List l) {
    final f = pffi.calloc<ffi.Uint8>(l.length);
    try {
      f.asTypedList(l.length).setAll(0, l);

      return NSData.dataWithBytes_length_(_lib, f.cast(), l.length);
    } finally {
      pffi.calloc.free(f);
    }
  }

  Uint8List get uInt8List {
    final rawBytes = bytes;
    if (rawBytes.address == 0) {
      return Uint8List(0);
    } else {
      // This is unsafe! It is only a view into the underlying NSData!
      return rawBytes.cast<ffi.Uint8>().asTypedList(length);
    }
  }
}

I think that the memory unsafety can be fixed with some effort:
class _NSDataUint8List implements Uint8List, Finalizable {
...
}

  Uint8List get uInt8List {
    final rawBytes = bytes;
    if (rawBytes.address == 0) {
      return Uint8List(0);
    } else {
      retain(); // Keep a reference alive so long as the data is being accessed.
      final uintList = _NSDataUint8List(rawBytes.cast<ffi.Uint8>().asTypedList(length));
      finalizer.attach(uintList, ....) // calls release on this NSData instance.
      return uintList;
    }
  }
}

These helpers were added in https://github.com/dart-lang/native/pull/1104
They're somewhat inefficient at the moment, but making them more efficient is tracked here: https://github.com/dart-lang/native/issues/1107


Update SvelteKit configuration

As of the latest SK releases, the vite part of svelte.config.js is now in a separate vite.config.js file. Updated this doc accordingly.

@didier thanks for the contribution!!


Rename py package

This PR completes moving the same as the Python bindings from simplesauce to saucebindings. It is contingent on creating a new PyPI listing and renaming this GitHub repository to
github.com/saucelabs/sauce_bindings
Otherwise this should all work as expected.

 Here is an overview of what got changed by this pull request:

Issues
======
- Added 1

Complexity increasing per file
==============================
- python/saucebindings/session.py  7

See the complete overview on Codacy

 Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- python/saucebindings/session.py  7

See the complete overview on Codacy

 Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- python/saucebindings/session.py  7

See the complete overview on Codacy

 Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- python/saucebindings/session.py  7

See the complete overview on Codacy

 Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- python/saucebindings/session.py  7

See the complete overview on Codacy

 Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- python/saucebindings/session.py  7

See the complete overview on Codacy

 Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- python/saucebindings/session.py  7

See the complete overview on Codacy

@joshmgrant looks good. Besides the merge conflicts

 Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- python/saucebindings/session.py  7

See the complete overview on Codacy

 Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- python/saucebindings/session.py  7

See the complete overview on Codacy


Persist the Tabs using query parameters

Persist the all notes and Favorites tab in the query parameters
When we are in the favorite tab and reload the app then the tab changed to the All notes tab
I would like to use the query parameters using react-router-dom
We can use the built in hooks to update the url and persist the tabs

IF you want To contribute I have assigned You the issue, You can Freely contribute to this project

I will start working on it

@soummyaanon can you tell me the env variables required for this project
There is not .env.example file to do so 🥲

Just now I have added those env. examples sorry I totally forgot to add env examples

@soummyaanon no problem I will pull the changes

Where can I get the below credentials
VITE_APPWRITE_COLLECTION_ID="your_collection_id"
VITE_APPWRITE_USERS_COLLECTION_ID="your_users_collection_id"

Are they present in the app write dashboard

Where can I get the below credentials
VITE_APPWRITE_COLLECTION_ID="your_collection_id"
VITE_APPWRITE_USERS_COLLECTION_ID="your_users_collection_id"

Are they present in the app write dashboard

Yes  like you have to create two collection in appwrite dashboard one is user and another is notes thats it


How I use resetful.

The api is resetful url ,How to use it on multi?
example:
https://www.google.com/a/b/c/d
https://www.google.com/a/b/e/f
https://www.google.com/a/b/g/h
https://www.google.com/a/b/i/j
The api is "https://www.google.com/a/b", and I params is "['c','d']","['e','f']","['g','h']","['i','j']".
sorry for my terrible english.

This could work.
use \Curl\MultiCurl;

$params = [
    ['c', 'd'],
    ['e', 'f'],
    ['g', 'h'],
    ['i', 'j'],
];

$multi_curl = new MultiCurl();

foreach ($params as $param) {
    $url = 'https://www.google.com/a/b/' . implode('/', $param);
    $multi_curl->addGet($url);
    echo $url . "\n";
}

$multi_curl->start();


Shell completion support

As this project is using clap, there is a related crate called clap_complete. This crate will generate shell completion scripts for bash, elvish, fish, powershell and zsh.
I could not find any related issues, so I thought I'd open a new one for a discussion on it. I have a very rough implementation on this working, it's still very unpolished though. I would definitely be willing to iterate on this implementation.
sample implementation
sample output
~/rust/huak on  master [!?] is 📦 v0.0.7-alpha.3 via 🐍 v3.10.4 via 🦀 v1.64.0
➜ eval "$(cargo run -- completion bash)"
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `target/debug/huak completion bash`

~/rust/huak on  master [!?] is 📦 v0.0.7-alpha.3 via 🐍 v3.10.4 via 🦀 v1.64.0
➜ huak
activate    audit       clean       doc         fmt         --help      init        lint        publish     run         update      --version
add         build       completion  fix         -h          help        install     new         remove      test        -V          version

Love the idea, thanks!


Support converting terminusdb 10 to terminusdb 11

This entire project is to support this conversion.

this has now been implemented. let's have specific bug reports for failing cases.


feat(connector-besu, conecctor-quorum): contractAbi optional parameter

Resolve #743
Depends on #731
Depends on #702

Resolved conflicts.

@AzaharaC One last thing, sorry for not mentioning this earlier: Could you squash these back down into just 2 commits, one for besu one for quorum? (or 3 max if both commits would depend on some change at the same time)


message length is in hex format

by default message length is in hex format , i want get message length in decimal format,
that is possible?

can overwrite Iso8583Message.java file, method of "getBytes()"
at line 223 , overwrite "Integer.toHexString(baos.size())"  to "Integer.toString(baos.size())" write byte[] is ok.
and also shold overwirte Iso8583MessageFactory.java file, method of "getDestData(byte[] srcData)"
at line 411, overwrite "Integer.parseInt(EncodeUtil.hex(dataLength), 16)" to "Integer.parseInt(EncodeUtil.hex(dataLength), 10)"
in order to make hex format to decimal format


Provide React Hooks

Today's the big day for React Hooks!
Assuming the API gets released, we should provide some hooks. Something like useRedux would be cool!
import * as actions from './actions'

function Counter() {
  const [count, {increment, decrement}] = useRedux(state => state.count, actions);

  return (
    <>
      Count: {count}
      <button onClick={() => increment()}>+</button>
      <button onClick={() => decrement()}>-</button>
    </>
  );
}

Note: Yes, I'm aware of useReducer. That is for a Redux-style reducer, but for a local component's state only. What we're building would be for the store's global state, using useContext under the hood.

Great issue. I was curious how this hook would affect Redux. Good to see the team is already thinking about how it can be used WITH Redux. Subscribing.

BTW, this wasn't coordinated at all, but React is telling us to do this 😄

In the future, new versions of these libraries might also export custom Hooks such as useRedux()

https://reactjs.org/docs/hooks-faq.html#what-do-hooks-mean-for-popular-apis-like-redux-connect-and-react-router

I'm already playing around with rewriting my #995 WIP PR for React-Redux v6 to use hooks internally instead of class components, and it looks way simpler so far.  I hope to push up something for discussion within the next couple days.
As for actually exposing hooks... yeah, some kind of useRedux() hook might be possible as well, but I haven't gotten my brain that far yet :)

looks legit. Isn't it a replacement for connect?

@sag1v : potentially, but only within function components (as is the case for all hooks).

@markerikson Yeah of course.
I'm a bit confused though, with this line:
const [state, {increment, decrement}] = useRedux(state => state.count, actions);
We are destructuring state.count into a state variable.
Shouldn't it be:
const [count, {increment, decrement}] = useRedux(state => state.count, actions);
Or:
const [state, {increment, decrement}] = useRedux(state => state., actions);

Aw sorry didn't mean to offend, I just thought i was missing something. :pensive:

No worries :)  Just pointing out that it was simply a typo.

Fixed!

Would this be able to fix long-standing issues (/weaknesses) from the current wrapping-implementation, like those shown in #210 ?

Hey all, I experimented with a custom hook for a Redux store.
It's based on my library easy-peasy which abstracts Redux but it returns a standard redux store, so this solution would work for Redux too.  It's a naive implementation but just wanted to illustrate to everyone the possibilities.
import { useState, useEffect, useMemo, useContext } from 'react'

export default function useEasyPeasy(mapStateToProps, mapActionsToProps) {
  const store = useContext(EasyPeasyContext) // replace this with Redux Context
  const [state, setState] = useState(mapStateToProps(store.getState()))
  const result = useMemo(() => [state, mapActionsToProps(store.dispatch)], [
    state,
  ])
  useEffect(() =>
    store.subscribe(() => setState(mapStateToProps(store.getState()))),
  )
  return result
}

See it in action here: https://codesandbox.io/s/l9634zozx7

A non-tested naive implementation:
const useStore = (mapStateToProps, mapDispatchToProps) => {
  const getProps = () => ({
    ...mapStateToProps(store.getState()),
    ...mapDispatchToProps(store.dispatch)
  })

  const [props, setProps] = useState(getProps())

  // updateProps will run only if store's state changed
  const updateProps = useCallback(
    () => {
      const nextProps = getProps()
      if (!shallowEqual(nextProps, props)) setProps(nextProps)
    },
    [store.getState()]
  )

  useEffect(() => store.subscribe(updateProps))

  return props
}

Usage:
const { count, increment } = useReduxStore(mapStateToProps, mapDispatchToProps)

I was thinking about this yesterday, after working on rewriting my #995 PR to use hooks internally.
There's an issue with how a hook like this would be written using our v6 approach.  In v5, we put the store into legacy context, and the connect components subscribe directly.  In v6, we put the store state into createContext, and the connect components read the store state object from context.
When we call useContext(SomeContext), React marks that component as needing to re-render whenever the context updates, exactly the same as if we'd done <SomeContext.Consumer>{(value) => {  }}</SomeContext.Consumer>.  That's fine with connect, because we want the wrapper component to run its update process, check to see if the extracted values from mapState have changed, and only re-render the wrapped child if those are different.
However, if I were to do something like const updatedData = useRedux(mapState, mapDispatch), then our function component would re-render if any part of the Redux state had changed, and there's currently no way to look at updatedData and bail out of rendering this function component if it's the same as last time.  @sophiebits and @gaearon confirmed the issue here: https://twitter.com/acemarke/status/1055694323847651335 .
Sounds like the issue is on their radar, and they'd like to have a way for function components to bail out of re-rendering before 16.7 goes final.

@Matsemann : using hooks won't fix the "dispatch in lifecycle methods" issue by itself, exactly.  The switch to using createContext in v6 is what would really matter.

@markerikson I updated my comment, did you see useSelector?
store.subscribe() will fire on every received action, but it'll bail out if that state slice didn't change.

@hnordt : I'm specifically talking about a useRedux() hook that based on the v6 PRs, where we put the state into context rather than the whole store.

@markerikson I think the "spit" of hooks is based on small units of work. useRedux would be "too much".
From Hooks Docs:

Separating independent state variables also has another benefit. It makes it easy to later extract some related logic into a custom Hook.

Here an example of what I would like to see for react-redux future implementation. Feel free to play with it or ask questions. Love the feedback!
https://codesandbox.io/s/mm0qq8p43x

Thinking more about this and was asking myself why can't we split apart the state, and dispatch? It would reduce what each hook is trying to do conceptually and be smaller re-usable parts. I organized my previous example and cleaned it up a bit more on a separate fork. Feel free to play around with it https://codesandbox.io/s/1o79n7o46q.

@timdorr what about the different ways of retrieving state? I provided 3 ways to do it. I think the string variant is good for simplifying the example for new users. Having a single function is good for those already used to the way connect works and can easily port existing code. The object structure is more for when you've have the connect where you already have predefined selectors.
Single Function Example
const state = useReduxState(state => ({
    count: countSelector(state),
    user: userSelector(state)
})

Object Example
const state = useReduxState({
    count: countSelector,
    user: userSelector
})

I think for larger projects having this object notation cleans up a lot of noise around mapping data. I suppose this can be pushed off on the user to implement and they would map their object with this single function. It could look like this.
Sample implementation
const reduxObject = (selectorObject) => (state) => Object.keys(selectorObject).reduce((selected, key) => {
   selected[key] = selectorObject[key](state)
   return selected;
}, {})

Sample use case
const state = useReduxState(reduxObject({
    count: countSelector,
    user: userSelector
}))

what do you think? I prefer to have this logic in the useReduxState, but wondering your thoughts on this.

Why not something like this:
import { useState, useEffect } from 'react'
import store from 'redux/store'
import objectCompare from 'libs/objectCompare'

const emptyFunction = () => ({})

export default function useRedux(mapStateToProps = emptyFunction, mapDispatchToProps = emptyFunction) {
  const stateToProps = mapStateToProps(store.getState())
  const dispatchToProps = mapDispatchToProps(store.dispatch)

  const [state, setState] = useState(stateToProps)

  useEffect(() => store.subscribe(() => {
    console.log(`Running subscribe`)

    const newStateToProps = mapStateToProps(store.getState())

    console.log('newStateToProps', newStateToProps)
    console.log('stateToProps', stateToProps)

    if (!objectCompare(newStateToProps, stateToProps)) {
      console.log('setState')

      setState(newStateToProps)
    }
  }))

  return {
    ...state,
    ...dispatchToProps
  }
}

import React from 'react'
import { useRedux } from 'hooks'
import { increaseCounter, nothingCounter } from 'redux/ducks/counter'

const mapStateToProps = ({ counter }) => ({ counter: counter.value })
const mapDispatchToProps =  dispatch => ({
  increase: () => dispatch(increaseCounter()),
  nothing: () => dispatch(nothingCounter())
})

export default function Block1() {
  const {
    counter,
    increase,
    nothing
  } = useRedux(mapStateToProps, mapDispatchToProps)

  return (

{counter}

      <button onClick={increase} children={'Click me'}/>
      <button onClick={nothing} children={'Nothing'}/>

  )
}

I tried to implement type safe version with typescript.
// full implementation https://gist.github.com/mizchi/5ab148dd5c3ad6dea3b6c765540f6b73
type RootState = {...};
const store = createStore(...);

// Create React.Context and useXXX helpers with State
const { Provider, useStore, useSelector } = createStoreContext<RootState>();

// State user
function CounterValue() {
  // Update only !isEqual(prevMapped, nextMapped)
  const counter = useSelector(state => ({ value: state.counter.value }));
  return counter.value: {counter.value};
}

// Dispatch user
function CounterController() {
  const { dispatch } = useStore(); // or just return dispatch to be safe?

  const onClickPlus = useCallback(() => {
    dispatch({ type: INCREMENT });
  }, []);

  const onClickIncrementHidden = useCallback(() => {
    dispatch({ type: INCREMENT_HIDDEN_VALUE }); // will be skipped by CounterView
  }, []);

  return (
    <>
      <button onClick={onClickPlus}>+</button>
      <button onClick={onClickIncrementHidden}>+hidden</button>
    </>
  );
}

function CounterApp() {
  return (

      <CounterValue />

      <CounterController />

  );
}

ReactDOM.render(
  <Provider store={store}>
    <CounterApp />
  </Provider>,
  document.querySelector(".root")
);

I do not have confidence useSelector is correct name. (useMappedState(fn)?)
IMO, name of redux (or Redux) is just library name, not behavior.

@JesseChrestler alternative version for you string variant:
const items = useStoreValue`todos.items`;

Don't want to be the Debbie Downer at this party, but should we not maybe aim to
get a release out that supports the current, existing, and stable broken things
(like getDerivedStateFromProps) before re-writing/exposing an early-stage
proposal?

@deecewan : we're working on it :) See #1000. I was hoping to get through my cleanup work on that this weekend, but was otherwise occupied. Hopefully in the next couple days.
Also, note that most of the discussion in this thread has been from others besides Tim and myself.

Yep, this is just a tracking issue to let others know we know and to make sure we implement them when/if they're available.

@ctrlplusb
I'm just thinking about the design of these hooks a bit - I think finer-grained hooks for actions and state make more sense than a coarse-grained useRedux hook. Tweaking your example slightly, what if it were like this:
import React from 'react'
import { useState, useAction } from 'react-redux'
export default function Todos() {
const todos = useState(state => state.todos.items)
const toggle = useAction(dispatch => dispatch.todos.toggle)
return (

Todos
{todos.map(todo => (

 toggle(todo.id)}>
{todo.text} {todo.done ? '✅' : ''}

))}

)
}

@darthtrevino : WhyNotBoth.jpg :)
More seriously, I can imagine that we might offer all of those - useReduxState() (mapState by itself), useReduxActions() (mapDispatch by itself), and a combined useRedux() that does both (and probably uses both internally or something).

That's fair, I just think it's worth working through the design alternatives a bit before committing to any

I'm just stoked AF to use hooks everywhere

react useReducer
const [state, dispatch] = useReducer(reducer, initialState);
As @timdorr stated in the first post

Yes, I'm aware of useReducer. That is for a Redux-style reducer, but for a local component's state only.

@markerikson you mentionned links:

https://github.com/philipp-spiess/use-store
const [substate, dispatch] = useSubstate(state => { return { count: state.count }; });
possible clash dispatch

https://github.com/ianobermiller/redux-react-hook
const dispatch = useDispatch();
possible clash dispatch

https://github.com/martynaskadisa/react-use-redux
this one is fine

and @timdorr proposal
const [count, {increment, decrement}] = useRedux(state => state.count, actions);
this one is fine too
the react useReducer is too much redux stylish...

Here's an idea for something that can be used to bail out on invoking the component, but this will only work with functions and not exotic components:
function withRedux (mapStateToProps, mapDispatchToProps) {
  return function factory (componentFunction) {
    Component.displayName = componentFunction.displayName || componentFunction.name
    return React.memo(Component)

    function Component (props) {
      const store = useContext(ReduxContext)
      // do subscription effect / mapStateToProps / mapDispatchToProps
      const previousRender = useRef(undefined)
      if (/* props/mapStateToProps/mapDispatchToProps didn't change */) {
        return previousRender.current
      }
      return (previousRender.current = componentFunction(props))
    }
  }
}

It also won't bail out on reconciling children, only on rendering this specific component.

I might be arriving late to the party but this is how I’ve been doing global state with hooks.
It’s far from a full solution but I wonder if it could be applied for Redux
https://codesandbox.io/embed/n31n1lw6ml
(Grabbing a local components state update function and adding/removing it as a subscription via useEffect)

BTW, to be clear about versioning stuff, here's what I'd like to do:

6.x.0 - Add Hooks as a new API and maintain a React >= 16.4 compat. Add invariant checks around Hooks for React <16.7. No other changes to the library.
7.0.0 - Start using Hooks internally for our existing connect() API. Require React >= 16.7.

So, a minor and then a major. We go all-in, but gradually. Obviously, this depends a lot on how Hooks turn out, both from an API/pattern perspective and a performance/ergonomics perspective.

I'm surprised at how similar my implementation of this is to you guys'. I just stumbled upon this thread when i was going to check if react-redux was doing something with hooks 😅
Basically i've got something like:
const [count, actions, dispatch] = useStore('count', { increment, decrement })
You can choose between passing a string like 'a.b.c.d' vs a function like state => state.a.b.c.d. Second argument to useStore is an object of action creators that will be bound via bindActionCreators the first render. useStore returns an array containing: state, bound actions & the dispatch function (just in case :-)).
I've got two examples here, one very simple example (counter/Counter.js) and one using a reselect selector (users/UserList.js)
See the sandbox: https://codesandbox.io/s/lx6yp1578z

Hello All,
I'm just coming from Angular to React (with typescript) and hoping to help keep the types a bit cleaner(and more extendable) than I've see in some of the more prominent libraries. I've distilled what seems to be the essence of these useRedux examples to the following: https://gist.github.com/baetheus/ee94b4cb172eefeafd1ab8c13abcf77e
Notable Differences

useReduxFactory takes a context as an argument. It assumes that the entire store is passed to it for now, but this could be extended to accept a frozen store reference (to avoid unnecessary rerenders) as was referenced in https://github.com/reduxjs/react-redux/issues/1063#issuecomment-433474434
useRedux accepts a selector and a comparator function. This keeps users from being stuck with insufficient diffing mechanisms between renders.
useRedux returns the selected state and the dispatch method. I'm really not sure why action factories are being passed through the useRedux hook. It doesn't seem like they are changed at all and would already be available to the scope of the function anyway.
Typescript types that inherit well from the existing redux and react typings.

The intent with mapDispatchToProps is specifically to hide dispatch from the component, and have it call functions with known names instead. This is helpful when testing the inner component as you don't have to provide a mock dispatch which needs to be aware of the action creator return type implementation details; just mock action creators that only have to care about what the input arguments are.

@Kovensky This makes sense for a higher order component passing functions to a presentational component, but does it makes sense in the context of a stateful component?
In the example I provided it would be the same amount of code to mapDispatchProps outside of the useRedux hook as it would inside. The difference is that by keeping the hook focused on selecting from the store with the dispatch mappings separate there is less for the useRedux hook to do. The coupling is looser, the cohesion is higher.

Hi,
I thinks we can handle with to hooks useDispatch and useStateMapper.
We can pass action to useDispatch and then it will return memoize function.
useStateMapper will return mapped key with redux store and return value, in this function we have to create useEffect hook as explained by @ctrlplusb but with shallowEqual comparison.
useStateMapper should accept string or function to map.
Please See this code on code sand box to find out how these too hooks works exactly.
I have made a package named react-redux-peach will provide these two hooks and you can see and talk to me about this solution.
In react-redux-peach package I have used another package named redux-peach, it combine action and its reducers in one object and make better DX to use redux and actions.

Typescript combining a lot of ideas here + concat hook convenience:

const Context = createContext<Store<any>>(undefined as any);

const useSelector = <S, R, C>(selector: OutputSelector<S, R, C>) => {

  const store = useContext(Context);
  const [ state, setState ] = useState(selector(store.getState()));

  useEffect(() => store.subscribe(() => {
    const newState = selector(store.getState());
    if (state !== newState) setState(newState);
  }));
  return state;
};

const useDispatch = <A extends Index<any>>(actionsMap: A) => {
  const store = useContext(Context);
  return useMemo(() => Object
    .keys(actionsMap)
    .reduce((acc, key) => {
      acc[ key ] = (...args: any[]) => store.dispatch(actionsMap[ key ](...args));
      return acc;
    }, {} as any), [ actionsMap ]);
};

interface ConcatHooks {
  <T1>(f1: () => T1): T1;
  <T1, T2>(f1: () => T2, f2: () => T2): T1 & T2;
  <T1, T2, T3>(f1: () => T1, f2: () => T2, f3: () => T3): T1 & T2 & T3;
}

const concatHooks: ConcatHooks = R.pipe(R.unapply(R.identity), R.chain(R.call), R.mergeAll);

const listings = createSelector(...);
const listing = createSelector(...);

const useListings = () => useSelector(listings);
const useListing = () => useSelector(listing);
const useActions = () => useDispatch({l listingSelected });

const Listings: React.SFC = memo(() => {

  const { listings, listing, listingSelected } = concatHooks(useListings, useListing, useActions);

  return (
    <FlatList<any>
      data={ listings }
      renderItem={ (props) => (
        <ListingItem
          { ...props }
          onPress={ (item) => listingSelected({ key: item.key }) }
        />
      ) }
      ListHeaderComponent={ () => (
        <Text>{ listing ? listing.key : 'None selected' }</Text>
      ) }
    />
  );
});

@ctrlplusb @hnordt @chrismcleod:
I think the variants of the useState/useSelector hooks that you have posted share a common problem. Taking @hnordt's example:
const useSelector = selector => {
  const { getState } = useContext(ReduxContent)
  const [result, setResult] = useState(selector(getState()))

  useEffect(
    () =>
      store.subscribe(() => {
        const nextResult = selector(getState())
        if (shallowEqual(nextResult, result)) return
        setResult(nextResult)
      }),
    []
  )

  return result
}

Here the value of result inside the store.subscribe callback is closed over the value of result when the component first renders and is never updated. Thus, the check shallowEqual(nextResult, result) is likely to almost always be false.
Right now, I'm not sure of the right way to fix that.

I created redux-hooker for those who are interested. Have a look at github.com/linde12/redux-hooker
Basically useStoreState is a subscribe with shallow eq check, useActions is a memoed bindActionCreators. I dont think it has to be much more complicated than that.

@linde12: nice! How could this be combined with memoized selectors? Thanks a lot for all your Initiatives, folks!

@PatricSachse do you mean like reselect?
In that case you would do it something like this:
const selectUserList = createSelector(...)
const userList = useStoreState(selectUserList)

A variation on some of the above: https://github.com/Satyam/lacorazon/blob/master/src/store/hooks.js
It has both useDispatch and useSelector and both allow to get a whole bunch of dispatch-bound action creators and selected values at once, for example (from https://github.com/Satyam/lacorazon/blob/master/src/User.js#L17-L25):
export default function User({ match }) {
  const id = match.params.id;
  const { history } = useReactRouter();
  const [user, isLoading] = useSelector([selUser, selUsersIsLoading], id);
  const [doGetUser, doSetUser, doDeleteUser] = useDispatch([
    getUser,
    setUser,
    deleteUser
  ]);
// ...

Only one subscription to the store and one useEffect is used per call to useSelector which, I guess, could save some resources on large applications over calling it repeatedly for each selector.  You can also do like below, but it takes two separate subscriptions via useEffect:
  const user = useSelector(selUser, id);
  const isLoading = useSelector(selUsersIsLoading);

The selectors can be either functions or in the form of strings: (from https://github.com/Satyam/lacorazon/blob/master/src/store/users/selectors.js)
import { NAME } from './constants';
export const selUsers = NAME + '.data';
export const selUsersIsLoading = NAME + '.isLoading';
export const selUsersGotAll = NAME + '.gotAll';
export const selUser = NAME + '.data.%0';

The selUser selector could be written like this:
export const selUser = (state, id) => state[NAME].data[id];

The NAME constant tells where this particular slice of the store is kept, and also serves as a prefix for all action types, but this is not related to the hook in question  (see: https://github.com/Satyam/lacorazon/blob/master/src/store/users/constants.js)
The whole app in that repository is just an exercise to test some ideas, mostly trying out hooks, not for production.

How about https://github.com/facebookincubator/redux-react-hook. Will this be the official Hooks for Redux?

@jvitela : no.  Any official hooks will be part of this package, React-Redux.

This is how I would write it (I tested it, it works):
Usage:
import { useActions, useSelector } from 'react-redux';

const MyComp = () => {
  const [setLocale] = useActions([actions.setLocale]); // Wraps actions with dispatch
  const locale = useSelector(state => state.locale.current); // Selects value and re-renders if it changes

  return (...);
}

Implementation:
import React, { useState, useContext, useEffect } from "react";

export const useStore = () => {
  return useContext(ReactReduxContext);
};

export const useActions = (...actions) => {
  const store = useStore();

  return actions.map(action => (...args) => store.dispatch(action(...args)));
};

export const useSelector = (selectorFn, ...args) => {
  const store = useStore();
  let [curResult, setCurResult] = useState(() =>
    selectorFn(store.getState(), ...args)
  );

  useEffect(() => {
    return store.subscribe(() => {
      const nextResult = selectorFn(store.getState(), ...args);

      if (nextResult !== curResult) {
        curResult = nextResult; // for this function closure
        setCurResult(nextResult); // for the component
      }
    });
  }, []);

  return curResult;
};

@hnordt your implementation will call the selector on each render. Check out my implementation above which uses an initializer function for useState to avoid this

I just wanna say 👍 to the memoized useSelector pattern emerging above, I think selectors as a pattern and naming convention should be promoted over and above arbitrary state mappers. useSelector and useAction feel like the obvious primitives to me, and then a way to extend those into pluralised  versions useSelectors and useActions as a convenience.

I like @adamkleingit 's approach to this. Simple and performant.

@adamkleingit your solution doesn't unsubscribe.

@markerikson after catching up on all of the context stuff, i wonder, what if we could dynamically inject sub-contexts at the top of the component tree.  The values of these contexts would be memoized selectors of the root context state value and hooks would subscribe to these rather than the root context.  In a short sentence, a dynamically injectable context per selector.

@markerikson very interesting article! I had no idea react-redux has so much under the hood.
A few thoughts:

I assume useEffect runs in top-down order (?). If so, it doesn't introduce the bugs that you describe when rendering lists and then deleting an item.
Selectors that run in useEffect shouldn't delay React in any way as far as I know, right?
Do we really need memoized selectors in a world where each selector is separate and will only cause re-render if the return value changed?
I guess useSelector can accept extra options, like an isEqual function to compare selector results, and maybe debounce?

@adamkleingit : yup, that's one of the reasons why I wrote that post :)
Answering your questions:

I haven't tried checking what order useEffect calls run in. However, the "tearing" concern is about more than the top-down aspect - it's about different components possibly using different store state during the same render pass.
Not sure what you're asking here.
Also not sure what you're asking here either.  As I said in my last comment, see https://github.com/facebook/react/issues/14110 for our concerns with using new context, and function components re-rendering.
Yeah, definitely not following your train of thought here.  Why in the world would you debounce a selector?  How would a useSelector hook make use of isEqual?

I understand the problem now :) So for example parent component subscription gets called => parent state is updated => parent re-renders => child re-renders => child takes latest selector value which is outdated.
So the current direction is to keep the state in context, and wait for React to solve the problem of bailing out of re-render with useContext?

Basically, yeah.

What about, instead of passing the state through context, managing a list of selectors, and lazily subscribing to the store only once? Then if the state changes, go over the list of selectors and invoke them using the same state. And if the return value changed - call the useState callback (which is also saved alongside the selector)?
Like this:
https://codesandbox.io/s/y31zop4nxz

BTW, doesn't React already handles this internally?
I mean, the update function returned as 2nd arg from useState synchronously updates the internal state saved in React, but asynchronously forces the components to re-render.
Am I right?

No, the state is not synchronously updated.  The queued state changes are applied as part of the re-rendering process.

But are they all applied before the rendering starts? Or they might occur alongside rendering?
BTW, what do you think about my proposed solution instead of using context?

Excuse me , Is there any solution to integrating  react hook into react-redux after a long discussion above?


import onnx ml operations as a separate dialect

gen_doc.py
A option is added to generate inc files for onnx ml operation: --domain="ONNX_ML". Default is ONNX for onnx dialect

MLONNX dialect
In Dialect/MLONNX, basic operation definition with TableGen.

Builder
MLONNX is included in the frontend.

Project control
By default, the MLONNX dialect is included in build. Use EXCLUDE_ONNX_ML=1 to cmake to disable  ONNX ML in build.

After this PR is merged, other components for MLONNX, such as documentation and test, will be added.

gen_doc.py
A option is added to generate inc files for onnx ml operation: --domain="ONNX_ML". Default is ONNX for onnx dialect

Can we refactor this into separate generator files? It would be much cleaner and easier to maintain if we had a generator file for each dialect. We should also take this opportunity to change the name to something more meaningful:
gen-onnx.py
gen-onnx-ml.py

Any functionality that is common to the two generators can be factored out into a separate file:
gen_utils.py

The two share all the code except for the name of dialect in output. No need to separate them. Unnecessary effort at least at current stage.

I think we need to always generate and build the ONNX ML since it's a dialect that we support. Using the dialect is up to the user.

Can one of the admins verify this patch?

@jenkins-droid test this please.

@doru1004 I updated this patch and invoked the Jenkins. Can we complete this patch first?


add workspace as a filter to fleet clusters list

Addresses issue 6363

add workspace as a filter to fleet clusters list so that list view becomes reactive to workspace change on header

@jameson-mcghee

This will fix filtering for the fleet cluster list view but not other workspaced resources (repos, cluster groups, bundles). I think the underlying issue is that the filtering that should happen here https://github.com/rancher/dashboard/blob/master/shell/components/ResourceTable.vue#L198 uses a getter that doesn't pick up on workspace changes. The activeNamespaceCache was added to reduce the need to iterate over many namespaces but that concern doesn't apply to workspaces (we're switching between single workspaces rather than creating a list of 'all user' 'all system' etc) I don't think we need to track WorkspaceFilter updates in activeNamespaceCache. I think it would be enough to update the ResourceTable filteredRows to check currentProduct.showWorkspaceSwitcher and use the workspace getter instead of activeNamespaceCache when relevant. I found another issue when switching between two workspaces with the same number of whatever resource is currently viewed but I think its a flaw in SortableTable and will file a separate issue.

Closed in favour #6524


allow to set credentials related filenames/secret keys by flags

Description
This add 3 flags to allow to change the values for TLS related filenames (usually used as keys in Secret object) to each binary.
Issue reference
#4428
Checklist
Please make sure you've  completed the relevant tasks for this PR, out of the following list:

[x] Code compiles correctly
[ ] Created/updated tests
[ ] Unit tests passing
[ ] End-to-end tests passing
[ ] Extended the documentation / Created issue in the https://github.com/dapr/docs/ repo: dapr/docs#[issue number]
[ ] Specification has been updated / Created issue in the https://github.com/dapr/docs/ repo: dapr/docs#[issue number]
[ ] Provided sample for the feature / Created issue in the https://github.com/dapr/docs/ repo: dapr/docs#[issue number]

Hi @yaron2 @daixiang0 , I didn't get if this is gonna to be merged/included or what? Is it something needed to have this merged and released?

@safanaj please resolve the last linter warnings and we can merge this.
https://github.com/dapr/dapr/pull/4699/files

@yaron2 if I understood what were the linter warnings I removed the type in the var declarations.

@yaron2 if I understood what were the linter warnings I removed the type in the var declarations.

Thanks, there's just a simple conflict to resolve now. Will merge once that's done.

Thanks for your contribution @safanaj!


bugfix: fix mountpoint binary not found error

In some linux releases, the mountpoint is not under /usr/bin dir, which
causes the failure of tmpfs detachment. So we only use the mountpoint,
which is in the system path
Signed-off-by: Eric Li<EMAIL_ADDRESS>
Ⅰ. Describe what this PR did
In some linux releases, the mountpoint is not under /usr/bin dir, which
causes the failure of tmpfs detachment. So we only use the mountpoint,
which is in the system path
Ⅱ. Does this pull request fix one issue?

fixes #1252
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews

Codecov Report

Merging #1253 into master will increase coverage by 0.08%.
The diff coverage is 0%.


Incompatible account handling

https://github.com/polkadot-js/extension/issues/1250

@ltfschoen Can you provide us more info for this issue? Thanks!

https://github.com/polkadot-js/extension/issues/1250#issuecomment-1510146933
https://github.com/polkadot-js/extension/issues/1250#issuecomment-1510140844
dapps need to filter based on chain type. so maybe have to filter Ethereum H160 addresses differently than for Substrate H256 addresses.

polkadot-js/extension#1250 (comment)
polkadot-js/extension#1250 (comment)
dapps need to filter based on chain type. so maybe have to filter Ethereum H160 addresses differently than for Substrate H256 addresses.

How did you create an Ethereum wallet in your polkadot js?

i had a quick glance, maybe take a look here
https://github.com/zeitgeistpm/ui/blob/staging/lib/hooks/queries/useAccountAssetBalances.ts
https://github.com/zeitgeistpm/ui/blob/staging/lib/state/wallet.ts
https://github.com/polkadot-js/common/blob/master/packages/util-crypto/src/address/encode.ts

i had a quick glance, maybe take a look here
https://github.com/zeitgeistpm/ui/blob/staging/lib/hooks/queries/useAccountAssetBalances.ts
https://github.com/zeitgeistpm/ui/blob/staging/lib/state/wallet.ts
https://github.com/polkadot-js/common/blob/master/packages/util-crypto/src/address/encode.ts

Sorry I'm not following, I'm trying to reproduce the issue but I'm not sure how to create an Ethereum account in the Polkadot js wallet. Do you have any information on that?

polkadot-js/extension#1250 (comment)
polkadot-js/extension#1250 (comment)
dapps need to filter based on chain type. so maybe have to filter Ethereum H160 addresses differently than for Substrate H256 addresses.

How did you create an Ethereum wallet in your polkadot js?

personally i don't create ethereum accounts using polkadot.js. try creating them using desktop software that creates Ethereum addresses on an air-gapped local machine. verify that your download of that desktop software hasn't been compromised

polkadot-js/extension#1250 (comment)
polkadot-js/extension#1250 (comment)
dapps need to filter based on chain type. so maybe have to filter Ethereum H160 addresses differently than for Substrate H256 addresses.

How did you create an Ethereum wallet in your polkadot js?

personally i don't create ethereum accounts using polkadot.js. try creating them using desktop software that creates Ethereum addresses on an air-gapped local machine. verify that your download of that desktop software hasn't been compromised

Is it possible to get some steps to reproduce the issue you were seeing?

polkadot-js/extension#1250 (comment)
polkadot-js/extension#1250 (comment)
dapps need to filter based on chain type. so maybe have to filter Ethereum H160 addresses differently than for Substrate H256 addresses.

How did you create an Ethereum wallet in your polkadot js?

personally i don't create ethereum accounts using polkadot.js. try creating them using desktop software that creates Ethereum addresses on an air-gapped local machine. verify that your download of that desktop software hasn't been compromised

Is it possible to get some steps to reproduce the issue you were seeing?

all the steps are written at this link https://github.com/zeitgeistpm/ui/issues/1084#issue-1675196447


Add integration test for self-eviction

This test validates self-eviction by:

stop gossiping in the whole cluster
send a SIGTERM  to SUT
validate if the SUT declares itself as faulty by pinging other members with the change

lgtm


Added my information(sam.json)

hey please merge my pull request i have added my information.

hey @TheSamarthShah , thanks for your PR. Welcome to the community.

hey @TheSamarthShah , thanks for your PR. Welcome to the community.

hey @TheSamarthShah , thanks for your PR. Welcome to the community.

My pleasure brother

hey @TheSamarthShah , thanks for your PR. Welcome to the community.

My pleasure brother

hey @TheSamarthShah , thanks for your PR. Welcome to the community.

If you have any other work I can do. But web development related 😅

hey @TheSamarthShah , thanks for your PR. Welcome to the community.

If you have any other work I can do. But web development related 😅

Ofcourse you can contrbute to many open source projects, like click-short, certificate-generator, codeforcause.org website or desktop app if you like.
click-short, certificate-generator: they are very new projects and are at the beginning of development ,if you like to test them out you could. Feel free to ask any doubt you come across.

Ofcourse you can contrbute to many open source projects, like click-short, certificate-generator, codeforcause.org website or desktop app if you like.
click-short, certificate-generator: they are very new projects and are at the beginning of development ,if you like to test them out you could. Feel free to ask any doubt you come across.

@TheSamarthShah
Ofcourse you can contrbute to many open source projects, like click-short, certificate-generator, codeforcause.org website or desktop app if you like.
click-short, certificate-generator: they are very new projects and are at the beginning of development ,if you like to test them out you could. Feel free to ask any doubt you come across.

Sure I'll check that out tomorrow morning 🙂. I would like to work.

@TheSamarthShah
Ofcourse you can contrbute to many open source projects, like click-short, certificate-generator, codeforcause.org website or desktop app if you like.
click-short, certificate-generator: they are very new projects and are at the beginning of development ,if you like to test them out you could. Feel free to ask any doubt you come across.

Sure I'll check that out tomorrow morning 🙂. I would like to work.


Use size of filtered column to reserve memory for filter when result_size_hint < 0

What problem does this PR solve?
Issue Number: close #6730
Problem Summary:
See #6730
What is changed and how it works?
If result_size_hint < 0, filter makes reserve using size of filtered column, not source column.
Check List
Tests

[ ] Unit test
[ ] Integration test
[x] Manual test (add detailed scripts or steps below)
[ ] No code

/// c is a string that is not equal to every b in table.
mysql> create table oom(a bigint, b varchar(200), c char(200));
Query OK, 0 rows affected (0.09 sec)

mysql> select count(*) from oom;
+----------+
| count(*) |
+----------+
|    60000 |
+----------+
1 row in set (0.02 sec)

mysql> alter table oom set tiflash replica 1;
Query OK, 0 rows affected (0.09 sec)

mysql> explain select * from oom o1 where (a,b,c) not in (select a,b,c from oom o2);
+--------------------------------------+----------+--------------+---------------+-------------------------------------------------------------------------------------------------------------------------+
| id                                   | estRows  | task         | access object | operator info                                                                                |
+--------------------------------------+----------+--------------+---------------+-------------------------------------------------------------------------------------------------------------------------+
| TableReader_27                       | 48000.00 | root         |               | MppVersion: 1, data:ExchangeSender_26                                                                                |
| └─ExchangeSender_26                  | 48000.00 | mpp[tiflash] |               | ExchangeType: PassThrough                                                                                |
|   └─HashJoin_25                      | 48000.00 | mpp[tiflash] |               | CARTESIAN anti semi join, other cond:eq(test.oom.a, test.oom.a), eq(test.oom.b, test.oom.b), eq(test.oom.c, test.oom.c) |
|     ├─ExchangeReceiver_14(Build)     | 60000.00 | mpp[tiflash] |               |                                                                                |
|     │ └─ExchangeSender_13            | 60000.00 | mpp[tiflash] |               | ExchangeType: Broadcast                                                                                |
|     │   └─TableFullScan_12           | 60000.00 | mpp[tiflash] | table:o2      | keep order:false                                                                                |
|     └─TableFullScan_11(Probe)        | 60000.00 | mpp[tiflash] | table:o1      | keep order:false                                                                                |
+--------------------------------------+----------+--------------+---------------+-------------------------------------------------------------------------------------------------------------------------+
7 rows in set (0.00 sec)

In master, this sql can reach 20GiB+ memory and OOM on my laptop.
After this patch, this sql can run successfully and the max memory is about 500MiB.

Side effects

[ ] Performance regression: Consumes more CPU
[ ] Performance regression: Consumes more Memory
[ ] Breaking backward compatibility

Documentation

[ ] Affects user behaviors
[ ] Contains syntax changes
[ ] Contains variable changes
[ ] Contains experimental features
[ ] Changes MySQL compatibility

Release note

Fix the issue that CARTESIAN semi join may use larger memory than expected.

/run-unit-test

/check-issue-triage-complete

/rebuild

/merge

/merge


Wrapping libcmark?

Hi @jgm! I noticed this line in the README:

It would be nice to have the gem build the library as a ruby extension, but I leave that for someone with more knowledge of ruby extensions to implement.

I have some decent experience doing this, and would actually prefer to consume the gem in that manner, so I don't mind making a PR to get this work going.
My question to you would be how you would prefer to keep the C project in sync with this wrapper? In the past, when wrapping C projects with Ruby, I've usually placed the C project as a submodule of the Ruby gem. When the C library is updated, you have to remember to go to the Ruby gem, update the submodule, and publish a new release (I usually do this in a single script). Does that approach make sense to you, or would you prefer something else?

+++ Garen Torikian [May 02 15 10:22 ]:

Hi @jgm! I noticed this line in the README:

It would be nice to have the gem build the library as a ruby extension, but I leave that for someone with more knowledge of ruby extensions to implement.

I have some decent experience doing this, and would actually prefer to consume the gem in that manner, so I don't mind making a PR to get this work going.
My question to you would be how you would prefer to keep the C project in sync with this wrapper? In the past, when wrapping C projects with Ruby, I've usually placed the C project as a submodule of the Ruby gem. When the C library is updated, you have to remember to go to the Ruby gem, update the submodule, and publish a new release (I usually do this in a single script). Does that approach make sense to you, or would you prefer something else?

Makes sense to me!


Make xls.parse a public method

Would you be open to a PR to make parse a public method: https://github.com/extrame/xls/blob/master/xls.go#L28?
I want to use this package to add xls support to a tool I have made. It already supports multiple file type parsing via a function which receives a slice of bytes, so being able use xls.parse directly would be very useful.
Many thanks!

I suggest to use xls.OpenReader(bytes.NewReader(bytes),"utf-8").
It is because the parse function is scheduled to be orverwrited by using reader instead, so I suggest you to use reader too.

Ok, if your implementation details are going to change it makes sense to not expose it.
Thanks!

P.S. Just in case anyone else references this in the future:
Your example would give the following error *bytes.Reader does not implement io.ReadCloser (missing Close method)
You can solve this by wrapping the bytes.NewReader in a ioutil.NopCloser()


⚠ DDoS-Relay EU-C-fra1-02 has degraded performance

In d47f1e0, DDoS-Relay EU-C-fra1-02 (http://<IP_ADDRESS>:42069/;csv) experienced degraded performance:

HTTP code: 200
Response time: 175 ms

Resolved: DDoS-Relay EU-C-fra1-02 performance has improved in 5637f97 after 12 hours, 16 minutes.


⚠ Processors has degraded performance

In 807d7fc, Processors ($STATUS_URL) experienced degraded performance:

HTTP code: 200
Response time: 42 ms

Resolved: Processors performance has improved in 6384f33.