Not showing all games

It shows only few games, when there are a lot available

Same, it seems that app showing games that are in priority list and no more

I can confim this too. KOTC is an active campaign and when i open Twitch channel for it manually, it states I am receiving drops but this is not showing up in the Inventory or in the games list.
If it helps, these campaigns were showing last night ~ 12 hours ago from this post.

Same problem. 2 games on the list

Hello o/
After some simple debugging, it seems that Twitch no longer reports all ongoing campaigns via GQL, if one is using the SmartTV login (like this miner does). The response comes through, but the "dropCampaigns" key is empty:

This means the miner has lost the ability to discover new, unprogressed campaigns, and thus won't add their games to the UI combobox.
The good news is that the "Game name" entry is just a text entry with a dropdown that lets you pre-select a "known" game name, but otherwise functions as any ordinary text entry. This allows you to just type in the name of a game you'd want to add, and add it to the list that way. Just make sure to not make any spelling mistakes, the comparison is case-sensitive, and requires the exact game name, as displayed on the Twitch campaigns page.
Another good news is that Inventory view seems to still be working, so any campaign that's already started, will continue to be returned, and thus handled by the miner like expected. This means you can login to Twitch on your PC or phone, pick a campaign you want to start, tune into some random stream to start the campaign (get the first minute of progress), and then let the miner handle it from there.
The bad news is that I have no immediate resolution to this problem. There is a chance this issue is only temporary, and campaigns view will return to normal later. Or it's permanent, and I'll need to figure out another way of getting that information later.

Thanks for being so quick to look into this DevilXD you are awesome

I just happened to be off work delegation and home today, so could spare a quick look at least. I'm going back tomorrow though, and it'll be another week before I'll be able to get some more free time.
Still not sure what to do here, the web version returns campaigns, but the miner version doesn't. Web version is protected by the integrity system, so can't use it. For now, all campaigns need to be started manually - after that, they'll appear in the inventory view and everything should work from there as expected.

No problems, not sure if this is related but KOTC aren't being picked up. I'm not linked (but i usually can get the drop anyway). even with manual addition (and the drop started), its not being picked up in the miner main section. It's recognised in the inventory. I have manually added King of the Castle,. Not sure if this is a naming issue or not being linked but I was able to pick up the drop in the past (can't remember if by the miner or on my own)

The miner requires a linked account to consider a drop "worth mining". That's most likely why.

would it be possible to have the app skim the webpage for looking at available campaigns or something like that?

The miner requires a linked account to consider a drop "worth mining". That's most likely why.

I deleted my current Twitch Drops Miner install and downloaded a fresh version, re-linked my Twitch, and still only seeing 1 option show in the list of games.

@MuffinzCat Viewing https://www.twitch.tv/drops/campaigns requires logging in, and logging in requires an authorization token. The miner already uses one, but it's been locked out of the page contents per this issue. What you see when you open the browser, is the page via your web authorization token, which is protected by the integrity system, which isn't beatable at this time, so using it is not possible. So no, it's not possible to "skim" the website in any way.
@KevinNovak That's expected, as this issue is caused by Twitch itself, not the miner installation or linking status, or anything like that. Note that you can still add games like before, albeit you'll have to type out their names yourself (or just copy-paste them from the website).

The miner requires a linked account to consider a drop "worth mining". That's most likely why.

I deleted my current Twitch Drops Miner install and downloaded a fresh version, re-linked my Twitch, and still only seeing 1 option show in the list of games.

This is part of the issue/bug.
See reply here: https://github.com/DevilXD/TwitchDropsMiner/issues/264#issuecomment-1666771153
There's currently no fix other than manually starting a drop and manually typing it into the list. The dropdown won't be working until there's either a workaround or twitch fixes their API (unless its intentional).

I'm starting to see some games show up in my list without me manually adding them. anyone else?

I'm starting to see some games show up in my list without me manually adding them. anyone else?

The only time I see the list update is if a new drop was started then it'll be added to the list. Assuming it's caching "known" drop campagins/streams/games.

You can watch it on the webpage for 1 minute, activate the treasure drop, and then open the software to continue hanging the treasure drop of this game normally

Since there seem to be some confusion around what exactly happens, so I'll try to explain.
The miner utilizes the "contents" of these two Twitch pages:

https://www.twitch.tv/drops/inventory
https://www.twitch.tv/drops/campaigns

These are also known in-short as just "inventory" and "campaigns". The contents are fetched via the underlaying page's GQL request, each of the pages having it's own, different one. The "campaigns" page request has currently been crippled/disabled/god-knows-what-exactly-happened, and as the result, only the "inventory" one remained.
The inventory request contains all information that you can see on the inventory page - this includes primarily the drops your account is currently in the process of earning. Having at least 1 minute or percent of progress on a drop is enough for it to appear on the inventory page, and be recognized by the miner. Thus, you can "manually" force certain drops/campaigns to appear there, by watching an eligible stream for at least one minute (eg. in the browser), enough to gain some progress on the drop - and the miner should pick it up from there, as it's able to still see the inventory like before.
The "campaigns" page was used to let the miner know about all campaigns that have no progress done towards them, and can be started - since that's gone now, that information is missing. This is also the main reason the game picker isn't displaying the games you'd expect - because it can only see those on the "inventory" page instead.
You can open https://www.twitch.tv/drops/inventory at any time, and whatever drops, campaigns and progress you can see there, should appear in the miner as well (may require a reload first).

would this mean that previously completed games would appear on the list again if it gets another campaign?

Yes and no. Yes, because normally, that's what usually happens, especially for games that get new weekly campaigns. No, because it's not guaranteed to happen, as not progressing a particular game's campaigns for a while, somehow disables this process and they stop appearing. At least that's how it used to work before, it could've changed now.

would it be possible to manually export/import the https://www.twitch.tv/drops/campaigns list or something along those lines if we are not able to fully automate it anymore

@Larsy93 I've already explained why it's not possible here: https://github.com/DevilXD/TwitchDropsMiner/issues/264#issuecomment-1668400485

@Larsy93 I've already explained why it's not possible here: #264 (comment)

"Manually" means that the user DLs the page in some fashion, or runs javascript that exports a JSON/.. of active campaigns to file/clipboard, and TwitchDropsMiner loads this info from file/clipboard.

This is a Python program, I don't want to have to introduce any Javascript or side loading into the application. Definitely won't be developing any browser extensions for this either.
I've remembered that there's an DropsHighlightService_AvailableDrops GQL request, one can call on a channel to get a list of drops that could be earned by watching said channel. The thing is, there's zero handling for this in the miner right now. Since campaigns discovery no longer works, I wouldn't be able to get an accurate list of channels that can be watched to progress said campaigns, until after the user manually adds the campaign to the inventory tracker, by watching at least one minute of a stream.
This pretty much calls for a way of manually adding channels to the miner, and the entire logic flow having to be reversed. Instead of the drop campaigns deciding which channels to use for progressing them, the channels themselves would report which drop campaigns they can progress. This also means having to replace the Priority game selector with a channel selector, although I think it can be left as-is and instead only adding a way to add channels would be enough.
I didn't want to do this as the whole thing was supposed to be as automatic as it was possible to do at the time, but now the times have changed, and this sounds like the only option that could work. The problem is, I've recently started the 4th month of my work delegation on a project in a remote location, so I still barely have any time for any actual coding and changes. I really wish this wasn't the case, but I can't help it.
I'll try getting to this in any spare time I will be able to find, but can't make any promises on when this will be added/changed.

Yeah that's okay, it'd be selfish of people to demand that you'd work on an issue, let alone one you didn't create yourself

Can say so much that only the games that show up in the dropdown is the only games it will mine. i have Overwatch 2 in my prioity list, but it won't gather the new torbjörn skin. so ATM it's only useable for 2 games. at least for me.

A very slight workaround is to start getting watch progress by clicking on a stream with drops available to start gaining progress and then letting the bot continue gaining the progress.

Changing the client-id of SMARTBOX in the constants file fixed the issue.
I noticed that with the user agent that is provided in the constants.py file, the client-id is not the same when I do request to twitch.tv and m.twitch.tv with the same user agent ( Mozilla/5.0 (Linux; Android 7.1; Smart Box C1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/<IP_ADDRESS> Safari/537.36 ) and a web browser ( Brave ).
Here is the "new" client-id : r8s4dac0uhzifbpu9sjdiwzctle17ff
I also don't know if the client-id used in the app is the same as this one but, for now, it works fine with everything back.
I don't know if it is really important to have an appropriate client-id with the device that the miner tries to "emulate" to have these kinds of information.

Is someone able to do a PR with the updated client ID?

@Alorf Interesting, but it's not exactly the ultimate solution yet. The integrity system protects only selected endpoints, with the crucial one being the drop claiming one. Fetching a list of campaigns doesn't require integrity authorization, so everything may seem to work at first, but then will end up with an error during the claim operation. Replacing Client ID that's not protected by the integrity system, with a one that is, doesn't lead anyone anywhere.
Have you claimed any drops with it yet?
As a side note, this opens up cross-token data access as a possibility. The mechanics of it will require a #220 level of implementation though, so it'll have to wait for sure, but it may become eventually necessary to keep this project alive.

I have a 15m long drop available to test this on, so I guess we'll find out soon.

@DevilXD I've done the R6S drops and it's worked as it normally would, however I'm keeping an eye on it. I am only a user, so I can only test to see if things like this work but it's looking promising from a temporary point.

Yes, it works, I tried with the Rainbow Six drops

https://github.com/DevilXD/TwitchDropsMiner/commit/70035cde36dc1c225e4ebedfbfc8cec7d0d30994 implements the new Client ID, with some more appropriate user agents to it. The pre-release build already compiled, so you can grab it and give it a shot.
Don't forget that, as with all Client ID changes, you'll need to reauthenticate the miner - for that, you need to delete the cookies.jar file and then login anew. If you'd like to unlink the old Smart TV token, go to the Twitch connections page and click on "Unlink" next to "Twitch for TV". Doing this is not required, but encouraged, as the old token never expires, and still gives access to your account to anyone who'd somehow (god forbid) obtain it. Your choice.
Let me know if it works or more needs to be done here.

The settings page on the software now show all available games and the inventory page shows all available campaigns, but I'm getting a "cannot connect to Twitch" on the "gathering channels" sequence on the main pane. No other log to speak of.

For that message to appear, Twitch server has to stop responding, or respond with an error. Unless you're a programmer or have programming experience, figuring out which one of the two is it is impossible.
All you can do is verify your internet connection, and try again.

The settings page on the software now show all available games and the inventory page shows all available campaigns, but I'm getting a "cannot connect to Twitch" on the "gathering channels" sequence on the main pane. No other log to speak of.

I'm having the same issue.

Yes, it turns out that new user agents messed up Spade URL extraction. I'm working on a quick patch, while I still have time.

Yes, it turns out that new user agents messed up Spade URL extraction. I'm working on a quick patch, while I still have time.
EDIT: It's done: 29fa220

Still stuck on "Gathering channels..." and after like 10~15 min you get "Twitch is down, retrying in 1 seconds..."

Yes, the quick patch resolves only the Spade URL extraction step, it does not resolve your connectivity to Twitch. "Twitch is down" message is shown on 5XX errors (Twitch server error), while "Cannot connect..." message is shown on a timeout (connecting took too long), or another error related strictly to connecting to Twitch (even before any response data is transmitted back).
I cannot help you solve this one, it can be anything:

You have actual, temporary internet connection problems.
You're using Wi-Fi connection with a poor signal strength.
Your AV (antivirus) is denying the connection because it's coming from an unsigned executable.
Your firewall is not letting the request through.
You're using a Proxy that doesn't seem to work like it should.
Some people need to login to some internal network server, to receive internet access in the first place - all calls redirect to it automatically, but that can break or fool the miner, usually resulting in weird errors.

You have a shared IP address and that usually complicates things; Twitch might be confused about how to respond, or has a limit and already responded, but not to your request specifically.
Twitch just doesn't like you and your PC very much, and has decided to not respond.

..., and the list just goes on and on. It'd take an eternity to debug every single connectivity issue case, everyone has it different, etc. I can only suggest where to look for a possible fix, but other than that, you're more or less on your own. None of this happens on my PC. I can say that after the change, the requests definitely take a longer time for me, as each loading step executes, but I can only blame Twitch being slow on it, since nothing else besides the client ID has changed.

Switched back to 137f540 for now.

So, I was having that issue. I was getting multiple "twitch is down" or "twitch stopped responding" messages.  I'm watching twitch on a different computer than TwitchDropsMiner is running, so I was also getting "Earned points for watching" from this other channel I was watching. I can also watch twitch on a browser on the machine that the Miner is running.
I'm from a different country, so I put on a US IP Address proxy - didn't change anything. Got the same behavior.
I deleted my environment, re-built it, re-downloaded the application, re-did the login and I was getting equally slow and unresponsive behavior - no proxy running. I alt-tabbed from my raspberry pi instance (where Miner is loading) and went to do something else. Came back, it loaded the channels and is currently idling for items.

I have no issues watching twitch on the raspberry pi instance or on any other computer on my network. I don't really know how to debug a python application, so I can't really help much more than this :D

Dev, my twitch is currently working with none of the changes poeple are giving a go. so if you need a test subject, I can volunteer :)

so far claimed R6 siege drop with only 5 min of gathering channels. no lost connection.
seems i don't have any trouble with latest dev build. Only when it goes idle, then it comes with this.
09:15:34: Claimed drop: Tom Clancy's Rainbow Six Siege Reveal Y8S3 Charm (1/1)
09:15:54: No active campaigns to mine drops for. Waiting for an active campaign...
09:15:56: ERROR: Exception in Websocket[6]
09:15:56: Traceback (most recent call last):
09:15:56:   File "websocket.py", line 166, in _handle
09:15:56:   File "websocket.py", line 214, in _handle_topics
09:15:56:   File "websocket.py", line 324, in send
09:15:56:   File "aiohttp\client_ws.py", line 165, in send_json
09:15:56:   File "aiohttp\client_ws.py", line 151, in send_str
09:15:56:   File "aiohttp\http_websocket.py", line 690, in send
09:15:56:   File "aiohttp\http_websocket.py", line 601, in _send_frame
09:15:56: ConnectionResetError: Cannot write to closing transport
09:17:24: Watching: Wookie_Legend

I've put the latest pre-release on my work PC (used the Github version, didn't build myself), and startup took roughly 2m and 30s:

I'm using my mobile phone as a router/hotspot, so the signal quality ain't that great, but still.
This whole "Mobile Web" Client ID seems to just be slow in general, for some reason. I wonder if Twitch is intentionally throttling it's speed, to push people into downloading the app instead. I guess only Twitch knows.
There isn't much I can do about this. The current request timeout is set to 10 seconds, which should be plenty to get a response already, but with Twitch being this slow, it may just not be enough. Increasing the timeout may reduce overall app performance in situations where the connection is unstable, leading to slower operation, but it may also improve overall reliability.
@DJ4everkill Please file a separate issue with that error, seems like something that needs to be worked on some more.

Can anyone confirm if the new release with the MOBILE_WEB Client ID uses more bandwidth than the previous one?

I've just been stuck on "gathering channels" for like the past 2 hours.. running commit version d5410b2

Can anyone confirm if the new release with the MOBILE_WEB Client ID uses more bandwidth than the previous one?

"Slight" difference :)

But at least the functionality is working again. Each rose has it's thorns.

Wait, that's the difference?  This would also explain why it's so slow all of the sudden.
I'll try looking into it in some free time.

On commit 137f540d62560524a9a511a7793616e6d4478e68 (i.e. before the recent mobile-related changes), HTTP requests the app make looked like this:

On commit d5410b2aa5ee6148ca3e01e04addd29a1ff4db91, they look like this:

A few observations:

Responses from m.twitch.tv can be up to four times slower than responses from twitch.tv

In constants.py, BASE_URL is set to https://twitch.tv, which causes an extra HTTP redirect. I propose changing it to https://www.twitch.tv instead

Since the app now uses mobile User-Agents, every request to twitch.tv also causes an extra HTTP redirect to m.twitch.tv. Perhaps something like this would be an improvement:
diff --git a/twitch.py b/twitch.py
index d940a26..6d36e1a 100644
--- a/twitch.py
+++ b/twitch.py
@@ -522,7 +522,7 @@ class _AuthState:
             jar = cast(aiohttp.CookieJar, session.cookie_jar)
         if not self._hasattrs("client_version", "device_id"):
             async with self._twitch.request(
-                "GET", BASE_URL, headers=self.headers()
+                "GET", "https://m.twitch.tv/", headers=self.headers()
             ) as response:
                 page_html = await response.text("utf8")
                 assert page_html is not None

After adding the changes I proposed, the list of HTTP requests should look like this:

Which is not as good as before, but a tiny bit better. There are still a bunch of requests being made to Twitch's main page, which I don't understand why since I'm not too familiar with how the app works internally.

I think I got it. This change removed the ability to extract client_version from Twitch's page, however, we still have two places where the app checks for their existence:
https://github.com/DevilXD/TwitchDropsMiner/blob/d5410b2aa5ee6148ca3e01e04addd29a1ff4db91/twitch.py#L520
And, most importantly, here:
https://github.com/DevilXD/TwitchDropsMiner/blob/d5410b2aa5ee6148ca3e01e04addd29a1ff4db91/twitch.py#L523
This second check is what is triggering the extra requests to Twitch's main page. Removing those client_version checks reduces the total list of HTTP requests greatly:

If someone wants my changes to test for themselves:
diff --git a/constants.py b/constants.py
index a40ca71..79023a8 100644
--- a/constants.py
+++ b/constants.py
@@ -80,7 +80,7 @@ MAX_TOPICS = (MAX_WEBSOCKETS * WS_TOPICS_LIMIT) - BASE_TOPICS
 MAX_CHANNELS = MAX_TOPICS // TOPICS_PER_CHANNEL
 # Misc
 DEFAULT_LANG = "English"
-BASE_URL = URL("https://twitch.tv")
+BASE_URL = URL("https://www.twitch.tv")
 # Intervals and Delays
 PING_INTERVAL = timedelta(minutes=3)
 PING_TIMEOUT = timedelta(seconds=10)
diff --git a/twitch.py b/twitch.py
index d940a26..7ea2c27 100644
--- a/twitch.py
+++ b/twitch.py
@@ -517,12 +517,12 @@ class _AuthState:
     async def _validate(self):
         if not hasattr(self, "session_id"):
             self.session_id = create_nonce(CHARS_HEX_LOWER, 16)
-        if not self._hasattrs("client_version", "device_id", "access_token", "user_id"):
+        if not self._hasattrs("device_id", "access_token", "user_id"):
             session = await self._twitch.get_session()
             jar = cast(aiohttp.CookieJar, session.cookie_jar)
-        if not self._hasattrs("client_version", "device_id"):
+        if not self._hasattrs("device_id"):
             async with self._twitch.request(
-                "GET", BASE_URL, headers=self.headers()
+                "GET", "https://m.twitch.tv/", headers=self.headers()
             ) as response:
                 page_html = await response.text("utf8")
                 assert page_html is not None

EDIT: I took a quick look, and there's nothing that could cause such an increase, the usual set of data is returned.

It's filtered by app that's why I can easily get a graph for either versions.
I attached a file of 5/08 which was a high traffic date on the old version. Also 17/08 which is today so far on the 29fa220 version.
Files show very quick that almost all the extra traffic is coming from m.twitch.tv while that hostname was never used before.
CnnHist-2023-08-17T20-39-57.csv
CnnHist-2023-08-17T20-40-45.csv

@guihkx i tried your "fix" and it seems to work. Ran through the whole night and ahvent encountered any problems so far.
Also it seems that the miner picks up "not yet started" campaigns again. Don't know if its a twitch-side change or not tho.

Can confiurm that the changes that @guihkx did in the patch file does make everything start up so much quicker and it doesn't seem to get stuck on gathering channels at all like d5410b2 does for me at least.

someone could send the compiled bot pls :P

I guess that's what I get for having too little time to do some proper testing. Thank you for figuring this out @guihkx.
https://github.com/DevilXD/TwitchDropsMiner/commit/e16ddeaa7b7b7c0a267590b801710dc958919959 implements these changes, hopefully. Please give the latest dev build a go and let me know if it's better now.

@DevilXD Testing the latest dev build as of right now and looks like everything is working perfectly! Starts up quickly, doesn't have the issue of getting stuck on the gathering channels bit and all around just seems like everything is better at the moment.

After 20 hours of running e16ddea and mining drops it also seems to be back at normal bandwidth. No longer m.twitch.net connections transferring gibs of data every day.

Would it be possible to create a "Chromium"-based cookie via headless browser and feed the miner that cookie?

Okay, but how would you login on Twitch using a headless browser (or any other remotely-controlled browser, for that matter)?
As far as I know, Twitch's integrity system (which @DevilXD literally spoke about in your quotation of his message) is currently undefeated.
In any case, right now I'd consider this issue to be fixed.

@Coldblackice This was already a part of this project at some point. Here's a short history summary:

Chrome login flow is added to the application (Nov 1, 2022)
Chrome login has some issues from time to time, but standard login works again, so normal login method is reintroduced - Chrome login kept as backup (Nov 19, 2022)
Chrome login stopped working a few days earlier, so it's disabled to not use it anymore (Dec 7, 2022)
Unused Chrome dependencies are removed to slim down on the application size (Apr 23, 2023)

The gist of it is that, Chrome login/access tends to work for a while, then not work for a while, then again work for a while, then not work, and so on. Every time it stops working, someone from the Selenium project sits down, makes it work again, and pushes out an update. Updating Selenium as a dependency in a pre-compiled project is impossible, without rebuilding and re-releasing the entire thing, a way I really do not like to go with. The new mobile login option works, so lets stick to this - I can try going back to Chrome flow later, once there will be no other option.

As @guihkx said, this issue is closed now. If a new issue arises, please open a new one.


RHIROS-1142 - Migrate to poetry from pipenv

Why do we need this change? :thought_balloon:
The pipenv has its own limitations as example it does not allow to update packages independently. Considering we have situations to update specific packages when needed switching to poetry.
Documentation update? :memo:

[ ] Yes
[ ] No

Security Checklist :lock:
Upon raising this PR please go through RedHatInsights/secure-coding-checklist
:guardsman: Checklist :dart:

[ ] Bugfix
[ ] New Feature
[ ] Refactor
[ ] Unittests Added
[ ] DRY code
[ ] Dependency Added
[ ] DB Migration Added

Additional :mega:
Feel free to add any other relevant details such as links, notes, screenshots, here.

Codecov Report
Patch and project coverage have no change.

Comparison is base (29d355c) 72.21% compared to head (ce057e3) 72.21%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #331   +/-   ##
=======================================
  Coverage   72.21%   72.21%
=======================================
  Files          27       27
  Lines        1346     1346
=======================================
  Hits          972      972
  Misses        374      374

Flag
Coverage Δ

unittests
72.21% <ø> (ø)

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

Finally this is ready for review! @kgaikwad @r14chandra @saltgen request to check, thank you!

@upadhyeammit I don't see commits post my last review, changes as per 142d1d6 seem fine.

/retest

I have rebased this on flask pr! Hoping the tests will pass, else would look into it

@r14chandra this is ready for review!

/retest

@upadhyeammit CI job is failing. Could you please take a look?

/retest

/retest

/retest

Thanks all for the review! Merging this now!


TryCatchThrow method added for every skin

The script generated by this package makes one TryCatchThrow method for every skin in a single mod, when it's only needed once, and causes errors when attempting to build. Whenever a new script is generated, in order to build the DLL, you have to manually delete the extra instances of the method.

Oh, missed that, thanks for the report, now should be fixed


Improperly formatted auth error

this is giving me an error stating "improperly formatted auth" when I try to enable. Any ideas?

Are you entering the oauth: bit in the OAuth Token field? That's required


Add "limit" option to apostrophe-pieces-widgets

People seem to want to add things like options: { limit: 1 } when configuring apostrophe-files singletons in schemas. apostrophe-images uses the following to bypass straight to file picking:
beforeConstruct: function(self, options) {
  if (options.by === undefined) {
    options.by = [ 'id' ];
  }
}

This should maybe be an option for anything extending apostrophe-pieces-widgets

To clarify, these are two separate concerns: limiting how many can be picked, and limiting the ways things can be picked (just "individually" versus "individually, by tag or all"). I've retitled this ticket to be about the first one. I'm not sure what to do with the second one. We can't break sites where people have already picked files "by tag." There's already an approach (above) if you want to lock it down for a specific project.

Yes, sorry - thanks for the clarification Tom.


ruflin/elastica version 8

Hello, is there any planned update of ruflin/elastica to version 8?

Hi, feel free to send PR.


Subquery in .from() in MySQL

Environment
Knex version: 0.14.2
Database + version: MySQL 5.7
OS: macOS 10.13.3
Bug
How can one perform a subquery in FROM field in MySQL?
I know it is possible in other dialects using .with but unfortunately that's not possible in MySQL at the moment, while .from() function accepts only table name as parameter.
I managed to overcome this by doing:
  .from(function() {
    this.from(mainQuery).as('main') // where mainQuery is a Knex.QueryBuilder object
  })

but unfortunately that hack works only once - if I want to have two nested subqueries in FROM it fails.
Query/code I'm currently working on:
# RAW Query
SELECT * FROM (
  SELECT main.*, @curRank := @curRank + 1 AS rank FROM
    (SELECT a.userUid, p.postUid, p.activityUid, p.repsNo, p.weight, p.points, p.dateCreated
    FROM users a
    JOIN posts p ON a.userUid = p.userUid
    INNER JOIN (
      SELECT userUid, MAX(points) AS maxPoints
      FROM posts
      WHERE isLift = 1 AND activityUid = ? AND activityType = ?
      GROUP BY userUid
      ORDER BY maxPoints DESC
    ) m ON a.userUid = m.userUid AND p.points = m.maxPoints
    ORDER BY m.maxPoints DESC, p.dateCreated DESC) AS main
  JOIN (SELECT @curRank:= 0) r
  ORDER BY rank
) AS rankQuery
WHERE userUid = ?

// Query converted to Knex
const maxPointsQuery = knex('posts')
  .select('userUid')
  .max('points AS maxPoints')
  .where({
    isLift: 1,
    verified: 1,
    activityUid
  })
  .groupBy('userUid')
  .orderBy('maxPoints', 'desc')
  .as('maxPerUser')

if (options.type) {
  maxPointsQuery.where({
    activityType: options.type
  })
}

const mainQuery = knex('users')
  .select(
    'users.userUid',
    'posts.postUid',
    'posts.activityUid',
    'posts.activityType',
    'posts.repsNo',
    'posts.weight',
    'posts.points',
    'posts.dateCreated'
  )
  .join('posts', 'users.userUid', '=', 'posts.userUid')
  .join(maxPointsQuery, function() {
    this.on('users.userUid', '=', 'maxPerUser.userUid').andOn('posts.points', '=', 'maxPerUser.maxPoints')
  })
  .orderBy('maxPerUser.maxPoints', 'desc')
  .orderBy('posts.dateCreated', 'desc')
  .as('main')

const rankQuery = knex // this query alone works perfectly fine
  .queryBuilder()
  .select('main.*')
  .select(knex.raw('@curRank := @curRank + 1 AS rank'))
  .from(function() {
    this.from(mainQuery).as('main')
  })
  .joinRaw('JOIN (SELECT @curRank:= 0) r')
  .orderBy('rank')
  .as('rankQuery')

const userSpecific = knex // this fails
  .queryBuilder()
  .select('*')
  .from(function() {
    this.from(rankQuery).as('rankQuery')
  })
  .where({ userUid })

Your example is not complete and its not minimal example showing that some nested query is not working correctly. Also this seems to be knex usage question that should go to stackoverflow.
Anyways here is one way to write your query https://runkit.com/embed/x1d96oa99g01 (I actually didn't write the same query, but you should be able to get the idea how I'm doing nesting):
require('sqlite3');
const Knex = require('knex');

const knex = Knex({
  client: 'mysql',
});

knex({
  rankQuery: knex.select('main.*', 'someMore').from({
    main: knex({a: 'users'})
      .select('a.b', 'p.p')
      .join({ p: 'posts' }, 'a.b', 'p.b')
      .innerJoin({
        m: knex('posts')
          .select('userUid')
          .where('a','b')
          .groupBy('userUid')
          .orderBy('maxPoints')
      })
      .orderBy('m.m')
  }).orderBy('rank')
})
.where('userUid', 'foo')
.toSQL()

outputs:
select * from (
  select `main`.*, `someMore` from (
    select `a`.`b`, `p`.`p` from `users` as `a`
      inner join `posts` as `p` on `a`.`b` = `p`.`b`
      inner join (
        select `userUid`
        from `posts`
        where `a` = ?
        group by `userUid`
        order by `maxPoints` asc
      ) as `m`
      order by `m`.`m` asc
  ) as `main`
  order by `rank` asc
) as `rankQuery`
where `userUid` = ?

@elhigu I never saw this way to build query
rankQuery: knex.select('main.*', 'someMore')

I was using the same way as @K0ff33 `.as('xxx') but most of the time, it does not do what we want.
Is it new? Where is it mentioned in the documentation?

Ok, I found something in the documentation near Identifier Syntax but if this is the only documentation, then I think it would be more details on that subject.

It is pretty new so is the Identifier syntax documentation. Before there was actually pretty much zero information about what kind of identifiers knex supports.

@elhigu I think the main question whether such syntax is compatible and does the same as .as('rankQuery') syntax, does it?

Object alias syntax should do the same thing.

@elhigu I'm trying to use the syntax you've proposed in TypeScript, and it fails with huge type-mismatch error. It seems that from() expects either string, QueryBuilder returning function of Raw. Any quick fix to this?

Any-casting always works with typescript problems :) Sounds like typings are wrong and should be fixed. Openin bugfix issue could be a slow fix for that.

Is there a way to use this from object syntax with an update query?
When I try:
  query = knex('phones')
    .update({ name: knex.raw('??.??', ['p', 'cat']) })
    .from({
      p: knex('phones').select(['id', 'cat']),
    })
    .where('id', knex.raw('??.??', ['p', 'cat']));

The SQL result is:
update (select `id`, `cat` from `phones`) as `p` set `name` = `p`.`cat` where `id` = `p`.`cat`;

instead of something like:
update `phones` set `name` = `p`.`cat` from (select `id`, `cat` from `phones`) as `p` where `id` = `p`.`cat`;

Full code to reproduce:
const knex = require('knex')({
  client: 'sqlite3', // or 'better-sqlite3'
  connection: { filename: "./mydb.sqlite" },
  useNullAsDefault: true,
});

run = async () => {
  // create database
  await knex.schema.dropTableIfExists('phones');
  await knex.schema.createTable('phones', function (table) {
    table.increments();
    table.string('name');
    table.string('cat');
    table.integer('order');
  });

  // insert
  await knex('phones').insert({ cat: 'A', name: 'Pixel 7', order: 0 });
  await knex('phones').insert({ cat: 'A', name: 'Pixel 7 Pro', order: 1 });
  await knex('phones').insert({ cat: 'B', name: 'Pixel 7 Mini', order: 2 });

  // query
  query = knex('phones')
    .update({ name: knex.raw('??.??', ['p', 'cat']) })
    .from({
      p: knex('phones').select(['id', 'cat']),
    })
    .where('id', knex.raw('??.??', ['p', 'cat']));

  console.log(query.toString());
  await query;
  const all = await knex('phones');
  console.log(all);

};

run();


Mechanical Arm not keeping selection

Describe the Bug
When I hold the mechanical arm and right click blocks e.g. blaze burners for depositing items, it marks them, however when I place the arm down it always indicates "No targets".
No crash, mechanical arm just not working for me.
Reproduction Steps

Hold mechanical arm
Right click blocks you want to deposit/pick up from
Place down mechanical arm

Edit:
Only on server in survival
On Singleplayer creative, it works
Expected Result
Mechanical arm to have selected blocks to deposit to
Screenshots and Videos

Crash Report or Log
No response
Operating System
Windows 11
Mod Version
0.5.0f
Minecraft Version
1.19.2
Other Mods
No response
Additional Context
No response

Can confirm / Reproduced

Can’t reproduce, please test patch G.

Please test 0.5.0g-791. If it still happens, provide your full mod list.

Reproduced with 0.5.0g-791 installed on both client and server
Only other mods on both client/server:
fabric api 0.67.1
starlight-1.1.1

Would like to butt in to say that I had this issue on patch F, and reduced my mods as much as possible to still have the same result. It worked properly on singleplayer, but wouldn't work on multiplayer.
I updated to patch G hoping it'd be fixed to have the same result. I tried a few different times and it wouldn't work at all. I wanted to contribute and record a video of it happening for a little proof. However, once I actually started recording, it miraculously started working.
I honestly have no idea what I did, but it works for me now after trying a few times. I'm now unable to reproduce the bug.

Can confirm, reproduced in singleplayer. it does work properly in survival if you are holding 2+ mechanical arms and works in creative because you have infinite amount of them

Confirming this also, just happened to me lol.


Its Not Starting in Replit

Error pls solve it

are you mobile or pc?

Mobile

dm me dahomiemiggy

thanks for the miggy :D


feat: creating, copying & moving in folder_browser

Closes #78
This commit enables creating, copying, and moving
files and folders from within folder_browser mode.
In doing so, the currently selected directory within
folder_browser serves as the target directory for the
corresponding telescope-file-browser action.

LGTM, and very cool!
Maybe we should add the destination path to the confirmation message, that would make it clearer.
What do you think?

Thanks :)
Do you mean the target_dir? name is already printed. I agree that can be improved, but I'd merge now as state-of-things suffice and will revamp messages/notifications eventually ideally via https://github.com/nvim-telescope/telescope-file-browser.nvim/pull/72


[D3D9] Fallout New Vegas Transparency Multisampling (ATOC) issue

Simply put, New Vegas employs NVIDIA's ATOC and AMD's A2M1/0 hacks for multisampling when doing AA, which when enabled with DXVK on causes dithering issues with grass/transparent/LOD textures.
Software information
Fallout: New Vegas Ultimate Edition v<IP_ADDRESS>5, ultra graphics preset.
System information

GPU: NVIDIA RTX 2060 Super
Driver: 528.24
DXVK version: 2.1

Apitrace file(s)
API Trace

This isn't a bug, the method of ATOC just differs on NV vs their DX9 driver.


handle continue as new transfer / timer tasks

Coverage decreased (-0.08%) to 65.941% when pulling 5bf15ef27b504b589a246ee1131f880977aeb27b on bugfix into b8c61d8a10effdccabb0147d11d4c07808d22abb on master.


Live Location is updating after every 2 sec while in Driving Mode

Live Location is updating after every 2 sec while in Driving Mode.
FlutterMap(
options: MapOptions(
center: const LatLng(0, 0),
zoom: 1,
maxZoom: 19,
),
children: [
TileLayer(
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: const ['a', 'b', 'c'],
maxZoom: 19,
),
CurrentLocationLayer(),
],
)

yes i tried with different positionStream values, but with high Accuracy as well it's taking 2 sec to update live location while Driving

Is it a problem from geolocation package? If yes, please create a issue in that package since geolocation is just a default implementation but not neccessary to this package.


Add SQLite Aspire Component

We will probably have both EF and non-EF components (just like the other database components).

https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Sqlite/
https://www.nuget.org/packages/Microsoft.Data.Sqlite.Core/

My use case would to combine sqlite with litestream as written up here, https://docs.servicestack.net/ormlite/litestream.

Unsure if we're doing this for v1.

I'm curious about how this would work if it was done. Would this only be for ephemeral databases (in which case how is it different to the app just creating its own .db file inside its own container?) or would it be persistent across deployments in some way? If it was persistent, where would the .db file be stored?
It would be great if there was some suitable persistent filestore available to mount into ACA containers but Azure file shares seem not to be recommended for this purpose.
The use cases for persistent SQLite (as opposed to Postgres/MySQL/etc) will be things like:

Parts of an application that are dealing with small amounts of traffic/data and gain no benefit from heaver DBs. Simply working with .db files on disk is a nice and easy developer experience.
Deploying 3rd-party application components that innately require SQLite and you can't control that (e.g., pgadmin4)
Experimentation/proofs-of-concept

... so I do think it would be a nice feature, and so wonder how it could be made to work in the long run.

I'm curious about how this would work if it was done. Would this only be for ephemeral databases (in which case how is it different to the app just creating its own .db file inside its own container?) or would it be persistent across deployments in some way? If it was persistent, where would the .db file be stored?
It would be great if there was some suitable persistent filestore available to mount into ACA containers but Azure file shares seem not to be recommended for this purpose.
The use cases for persistent SQLite (as opposed to Postgres/MySQL/etc) will be things like:

Parts of an application that are dealing with small amounts of traffic/data and gain no benefit from heaver DBs. Simply working with .db files on disk is a nice and easy developer experience.
Deploying 3rd-party application components that innately require SQLite and you can't control that (e.g., pgadmin4)
Experimentation/proofs-of-concept

... so I do think it would be a nice feature, and so wonder how it could be made to work in the long run.

I would love this to be supported, local .db files for local development and integrate with Turso would be amazing.


React 18 Support

Do this package work with React 18 as my repo is having some issues with reactRoot being undefined.

It works with React 18, can you share a detailed reproduction like a repo that I can take a look?


Support page followup

Adds features mentioned in https://github.com/zulip/zulip/issues/10824#issuecomment-484314474

[x]  Update discount label to include nonprofit discount %.

[x] Add suport for activating and deactivating realm.

[x] Add suport for scrubbing realm.

[x] Show the string_id of the realm to be scrubbed in confirmation modal.

[x] Move javascript to a js file as well as add fronted tests.

need to move the JS code to separate file to improve the scrub realm confirmation modal as well as add frontend tests. I am thinking of asking to enter the correct string_id in the confirmation modal in-order to proceed with scrubbing.
@rishig Also instead of scrubbing the realm instantly do you think we should implement a Queue system to scrub the realm after 1 or 7 days? Just in case we accidentally scub the realm or the organization want to undo scrubbing(unlikely currently but if we implement a UI that allows organisations to scrub realms). We can mention that in our policy as well that the data would be actually scrubbed only after a few days.

@rishig Instead of scrubbing the realm instantly do you think we should implement a Queue system to scrub the realm after 1 or 7 days? Just in case we accidentally scub the realm or the organization want to undo scrubbing(unlikely currently but if we implement a UI that allows organizations to scrub realms). We can mention that in our policy as well that the data would be actually scrubbed only after a few days.

Good question. I think if we eventually have a ScheduledFunction table, something like this will be relatively easy, but until then I would say not yet worth it (the volume of requests currently is quite low).
(Small comment: for the button I would make it not filled in.)

@rishig Updated.

Tim, I think this is ready for you to take a look.
Next steps here are probably to add confirmation paths for things like "reactivate realm" and "scrub realm", after deciding who should have the authority to make such a change (e.g. any admin, or just a primary admin.)

Merged, thanks @hackerkid!
@rishig by "confirmation paths", I assume you mean for the user to request it?  I think "reactivate realm" is probably going to be tricky conceptually, since we normally can't authenticate users once they've deactivated an organization.
Let's work on the primary owner concept next; we'll definitely want that for irrevocable, destructive thing like scrubbing the realm.

For confirmation paths: the next thing I was imagining was that

User emails support@ asking for their realm to be reactivated (or scrubbed)
We click a button on /activity/support that sends the right person an email with a confirmation link

That would cut out most of the work associated with these requests, I think.

Ahh yes, that makes sense as next steps as well.
On Mon, May 6, 2019 at 8:43 PM Rishi Gupta<EMAIL_ADDRESS>wrote:

For confirmation paths: the next thing I was imagining was that

User emails support@ asking for their realm to be reactivated (or
scrubbed)
We click a button on /activity/support that sends the right person
an email with a confirmation link

That would cut out most of the work associated with these requests, I
think.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/zulip/zulip/pull/12168#issuecomment-489895874, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAU6NWRBT6DMVIPVWNXEQLTPUD3GDANCNFSM4HHE774A
.


Humbug source generator returns incorrect list of generated files

The humbug source generator humbugGen returns all the files in src_managed instead of just the files generated by Humbug. This is the same behaviour as Scrooge has. With Scala 2.11 this causes compile errors.

This is now fixed as part of the latest Humbug version.


Minor Change - Removing erroneous space in example

Just removing an erroneous space in the stored procedure example.
Original: EXEC   managed_backup. sp_backup_master_switch @new_state=1;
Purposed: EXEC managed_backup.sp_backup_master_switch @new_state=1;

@chjonatms : Thanks for your contribution! The author, @MikeRayMSFT, has been notified to review your proposed change.

Reviewed and confirmed editorial correction.


Add Truffle TCK libraryDependencies to runtime-test-instruments.

Pull Request Description
Since #8685, there is the following error (warning) message from JPMS plugin when building runtime-test-instruments:
[error] Returned (10): Vector(/home/pavel/.cache/coursier/v1/https/repo1.maven.org/maven2/org/graalvm/sdk/nativeimage/23.1.0/nativeimage-23.1.0.jar, /home/pavel/.cache/coursier/v1/https/repo1.maven.org/maven2/org/graalvm/sdk/word/23.1.0/word-23.1.0.jar, /home/pavel/.cache/coursier/v1/https/repo1.maven.org/maven2/org/graalvm/sdk/jniutils/23.1.0/jniutils-23.1.0.jar, /home/pavel/.cache/coursier/v1/https/repo1.maven.org/maven2/org/graalvm/sdk/collections/23.1.0/collections-23.1.0.jar, /home/pavel/.cache/coursier/v1/https/repo1.maven.org/maven2/org/graalvm/polyglot/polyglot/23.1.0/polyglot-23.1.0.jar, /home/pavel/.cache/coursier/v1/https/repo1.maven.org/maven2/org/graalvm/truffle/truffle-api/23.1.0/truffle-api-23.1.0.jar, /home/pavel/.cache/coursier/v1/https/repo1.maven.org/maven2/org/graalvm/truffle/truffle-runtime/23.1.0/truffle-runtime-23.1.0.jar, /home/pavel/.cache/coursier/v1/https/repo1.maven.org/maven2/org/graalvm/truffle/truffle-compiler/23.1.0/truffle-compiler-23.1.0.jar, /home/pavel/.cache/coursier/v1/https/repo1.maven.org/maven2/org/graalvm/sdk/polyglot-tck/23.1.0/polyglot-tck-23.1.0.jar, /home/pavel/.cache/coursier/v1/https/repo1.maven.org/maven2/org/netbeans/api/org-openide-util-lookup/RELEASE180/org-openide-util-lookup-RELEASE180.jar)
[error] Expected: (13): List(org.graalvm.sdk:nativeimage:23.1.0, org.graalvm.sdk:word:23.1.0, org.graalvm.sdk:jniutils:23.1.0, org.graalvm.sdk:collections:23.1.0, org.graalvm.polyglot:polyglot:23.1.0, org.graalvm.truffle:truffle-api:23.1.0, org.graalvm.truffle:truffle-runtime:23.1.0, org.graalvm.truffle:truffle-compiler:23.1.0, org.graalvm.sdk:polyglot-tck:23.1.0, org.graalvm.truffle:truffle-tck:23.1.0, org.graalvm.truffle:truffle-tck-common:23.1.0, org.graalvm.truffle:truffle-tck-tests:23.1.0, org.netbeans.api:org-openide-util-lookup:RELEASE180)

This PR removes this error message by providing appropriate libraryDependencies to runtime-test-instruments.
Important Notes

Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:

[ ] Make sure that the error message is no longer present in the job output.

Can you elaborate and describe what does it mean appropriate library dependencies?

@JaroslavTulach The error message mentioned in the description comes from the JPMSUtils. More specifically, from this method https://github.com/enso-org/enso/blob/21d164ec3eb37b9eff0e030146dff8963de31ca8/project/JPMSUtils.scala#L81-L116
When you set modulePath to a list of modules, JPMSPlugin then tries to find these modules on the disk. There is no simple way how to tell the sbt to download a module (moduleID, for example org.graalvm.truffle % truffle-api % "23.1.0") if necessary. JPMSPlugin looks at every module in modulePath, tries to find it on the disk, and assembles the --module-path option. It expects that all the modules are on the disk. The only way to ensure that the modules are on the disk, is to put them inside libraryDependencies as well.
There may be some method in the sbt-librarymanagement API that does exactly that, but I was unable to find that. Hence, this workaround, and this error message.

Does there have to be a transitive closure of dependencies?

As mentioned in the comment here https://github.com/enso-org/enso/blob/542357addcc415311b519be3e0c64adce6adeaaf/project/GraalVM.scala#L48-L52 we cannot use simply org.graalvm.polyglot % js-community % "23.1.0", which contains a parent POM that has transitive dependencies for js language, because, once again, I was unable to find an appropriate method in the sbt-librarymanagement API that would solve this issue for me. So for now, we need to look at all the transitive dependencies of these modules and manually maintain them.


Pressing a filter button in the Network panel displays a red cross

Even if donating to the Red Cross is a good action, it sounds inappropriate to display subliminal message for this in the network panel :)
STR:

Open Firebug on this page
Switch to the Network panel
Press a filter button or the "Clear" / "Export" buttons
=> A red cross appear in place of the pressed button

Florent

Should be fixed with the above commit.
Florent

$fixed firebug-3.0.0-alpha.8


Added MILC token

Contains:

MILC logo
contract-map.json containing MILC contract address and details

MILC's website is: https://www.milc.global/
The contract address can be found on the website under FAQ.

Don't know why it failed now?

closing due to inactivity, feel free to reopen


Add support for session tracking

Summary
Add support for session tracking into the SDK, for measuring release health
https://docs.sentry.io/product/releases/health/setup/
Motivation
Sentry is MUCH more useful when you can understand release health and associated session metrics. Many other Sentry SDKs support this, golang should as well.

While we are eventually going to roll Release Health into more platforms, currently we support just a few as we iterate and validate the product.
We can use this issue to track interest and help us prioritize.

Related to #335.
Developer docs: https://develop.sentry.dev/sdk/sessions/

Is there any update on this? We've hit this issue and were super surprised that the Go SDK was missing this feature. It's pretty key for us understanding how migration is going for the tools we're developing.
This forces us to use Datadog to track this, when Sentry is really where we want to visualize it 😭

Has your 2021 iteration and validation completed? Any plans to roll this out to golang?

I'm reopening this, though I can't commit to any timeline for when this feature will ship in the Go SDK.


feat: implement generate command

Description
This PR aims to implement generate command
Related issue(s)

Resolves #9

@magicmatatjahu should I create local types for https://github.com/asyncapi/generator or is there a plan for adding typescript support?

@Souvikns

should I create local types for https://github.com/asyncapi/generator or is there a plan for adding typescript support?

We have plan to add types https://github.com/asyncapi/generator/issues/468 but as I see you added types in this project. For me it's not a problem, we can always remove it and switch to the official typing.

@magicmatatjahu I need your help with this
For some reason, due to generate command the CLI is throwing ts error all over the project.
Currently, I am getting these warnings when I run CLI.

Error Logs
PS D:\Programs\AsyncAPI\cli> ./bin/run
(node:6664) TSError Plugin: @asyncapi/cli: ⨯ Unable to compile TypeScript:
src/commands/config/context.ts:2:5 - error TS7022: '__importDefault' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.

2 var __importDefault = (this && this.__importDefault) || function (mod) {
      ~~~~~~~~~~~~~~~
src/commands/config/context.ts:2:67 - error TS7006: Parameter 'mod' implicitly has an 'any' type.

2 var __importDefault = (this && this.__importDefault) || function (mod) {
                                                                    ~~~

module<EMAIL_ADDRESS>task: toCached
plugin: @asyncapi/cli
root: D:\Programs\AsyncAPI\cli
See more details with DEBUG=*
(Use `node --trace-warnings ...` to show where the warning was created)
(node:6664) TSError Plugin: @asyncapi/cli: ⨯ Unable to compile TypeScript:
src/commands/start/studio.ts:2:67 - error TS7006: Parameter 'mod' implicitly has an 'any' type.

2 var __importDefault = (this && this.__importDefault) || function (mod) {
                                                                    ~~~
src/commands/start/studio.ts:6:7 - error TS2451: Cannot redeclare block-scoped variable 'command_1'.

6 const command_1 = require("@oclif/command");
        ~~~~~~~~~

  src/commands/config/context.ts:6:7
    6 const command_1 = require("@oclif/command");
            ~~~~~~~~~
    'command_1' was also declared here.
src/commands/start/studio.ts:7:7 - error TS2451: Cannot redeclare block-scoped variable 'base_1'.

7 const base_1 = __importDefault(require("../../base"));
        ~~~~~~

  src/commands/config/context.ts:7:7
    7 const base_1 = __importDefault(require("../../base"));
            ~~~~~~
    'base_1' was also declared here.

module<EMAIL_ADDRESS>task: toCached
plugin: @asyncapi/cli
root: D:\Programs\AsyncAPI\cli
See more details with DEBUG=*
(node:6664) TSError Plugin: @asyncapi/cli: ⨯ Unable to compile TypeScript:
src/commands/config/context/add.ts:2:67 - error TS7006: Parameter 'mod' implicitly has an 'any' type.

2 var __importDefault = (this && this.__importDefault) || function (mod) {
                                                                    ~~~
src/commands/config/context/add.ts:6:7 - error TS2451: Cannot redeclare block-scoped variable 'command_1'.

6 const command_1 = require("@oclif/command");
        ~~~~~~~~~

  src/commands/config/context.ts:6:7
    6 const command_1 = require("@oclif/command");
            ~~~~~~~~~
    'command_1' was also declared here.
src/commands/config/context/add.ts:7:7 - error TS2451: Cannot redeclare block-scoped variable 'base_1'.

7 const base_1 = __importDefault(require("../../../base"));
        ~~~~~~

  src/commands/config/context.ts:7:7
    7 const base_1 = __importDefault(require("../../base"));
            ~~~~~~
    'base_1' was also declared here.

module<EMAIL_ADDRESS>task: toCached
plugin: @asyncapi/cli
root: D:\Programs\AsyncAPI\cli
See more details with DEBUG=*
(node:6664) TSError Plugin: @asyncapi/cli: ⨯ Unable to compile TypeScript:
src/commands/config/context/current.ts:2:67 - error TS7006: Parameter 'mod' implicitly has an 'any' type.

2 var __importDefault = (this && this.__importDefault) || function (mod) {
                                                                    ~~~
src/commands/config/context/current.ts:6:7 - error TS2451: Cannot redeclare block-scoped variable 'command_1'.

6 const command_1 = require("@oclif/command");
        ~~~~~~~~~

  src/commands/config/context.ts:6:7
    6 const command_1 = require("@oclif/command");
            ~~~~~~~~~
    'command_1' was also declared here.
src/commands/config/context/current.ts:7:7 - error TS2451: Cannot redeclare block-scoped variable 'base_1'.

7 const base_1 = __importDefault(require("../../../base"));
        ~~~~~~

  src/commands/config/context.ts:7:7
    7 const base_1 = __importDefault(require("../../base"));
            ~~~~~~
    'base_1' was also declared here.
src/commands/config/context/current.ts:8:7 - error TS2451: Cannot redeclare block-scoped variable 'Context_1'.

8 const Context_1 = require("../../../models/Context");
        ~~~~~~~~~

  src/commands/config/context/add.ts:8:7
    8 const Context_1 = require("../../../models/Context");
            ~~~~~~~~~
    'Context_1' was also declared here.

module<EMAIL_ADDRESS>task: toCached
plugin: @asyncapi/cli
root: D:\Programs\AsyncAPI\cli
See more details with DEBUG=*
(node:6664) TSError Plugin: @asyncapi/cli: ⨯ Unable to compile TypeScript:
src/commands/config/context/list.ts:2:67 - error TS7006: Parameter 'mod' implicitly has an 'any' type.

2 var __importDefault = (this && this.__importDefault) || function (mod) {
                                                                    ~~~
src/commands/config/context/list.ts:6:7 - error TS2451: Cannot redeclare block-scoped variable 'command_1'.

6 const command_1 = require("@oclif/command");
        ~~~~~~~~~

  src/commands/config/context.ts:6:7
    6 const command_1 = require("@oclif/command");
            ~~~~~~~~~
    'command_1' was also declared here.
src/commands/config/context/list.ts:7:7 - error TS2451: Cannot redeclare block-scoped variable 'base_1'.

7 const base_1 = __importDefault(require("../../../base"));
        ~~~~~~

  src/commands/config/context.ts:7:7
    7 const base_1 = __importDefault(require("../../base"));
            ~~~~~~
    'base_1' was also declared here.
src/commands/config/context/list.ts:8:7 - error TS2451: Cannot redeclare block-scoped variable 'Context_1'.

8 const Context_1 = require("../../../models/Context");
        ~~~~~~~~~

  src/commands/config/context/add.ts:8:7
    8 const Context_1 = require("../../../models/Context");
            ~~~~~~~~~
    'Context_1' was also declared here.

module<EMAIL_ADDRESS>task: toCached
plugin: @asyncapi/cli
root: D:\Programs\AsyncAPI\cli
See more details with DEBUG=*
(node:6664) TSError Plugin: @asyncapi/cli: ⨯ Unable to compile TypeScript:
src/commands/config/context/remove.ts:2:67 - error TS7006: Parameter 'mod' implicitly has an 'any' type.

2 var __importDefault = (this && this.__importDefault) || function (mod) {
                                                                    ~~~
src/commands/config/context/remove.ts:6:7 - error TS2451: Cannot redeclare block-scoped variable 'command_1'.

6 const command_1 = require("@oclif/command");
        ~~~~~~~~~

  src/commands/config/context.ts:6:7
    6 const command_1 = require("@oclif/command");
            ~~~~~~~~~
    'command_1' was also declared here.
src/commands/config/context/remove.ts:7:7 - error TS2451: Cannot redeclare block-scoped variable 'base_1'.

7 const base_1 = __importDefault(require("../../../base"));
        ~~~~~~

  src/commands/config/context.ts:7:7
    7 const base_1 = __importDefault(require("../../base"));
            ~~~~~~
    'base_1' was also declared here.
src/commands/config/context/remove.ts:8:7 - error TS2451: Cannot redeclare block-scoped variable 'Context_1'.

8 const Context_1 = require("../../../models/Context");
        ~~~~~~~~~

  src/commands/config/context/add.ts:8:7
    8 const Context_1 = require("../../../models/Context");
            ~~~~~~~~~
    'Context_1' was also declared here.

module<EMAIL_ADDRESS>task: toCached
plugin: @asyncapi/cli
root: D:\Programs\AsyncAPI\cli
See more details with DEBUG=*
(node:6664) TSError Plugin: @asyncapi/cli: ⨯ Unable to compile TypeScript:
src/commands/config/context/use.ts:2:67 - error TS7006: Parameter 'mod' implicitly has an 'any' type.

2 var __importDefault = (this && this.__importDefault) || function (mod) {
                                                                    ~~~
src/commands/config/context/use.ts:6:7 - error TS2451: Cannot redeclare block-scoped variable 'command_1'.

6 const command_1 = require("@oclif/command");
        ~~~~~~~~~

  src/commands/config/context.ts:6:7
    6 const command_1 = require("@oclif/command");
            ~~~~~~~~~
    'command_1' was also declared here.
src/commands/config/context/use.ts:7:7 - error TS2451: Cannot redeclare block-scoped variable 'base_1'.

7 const base_1 = __importDefault(require("../../../base"));
        ~~~~~~

  src/commands/config/context.ts:7:7
    7 const base_1 = __importDefault(require("../../base"));
            ~~~~~~
    'base_1' was also declared here.
src/commands/config/context/use.ts:8:7 - error TS2451: Cannot redeclare block-scoped variable 'Context_1'.

8 const Context_1 = require("../../../models/Context");
        ~~~~~~~~~

  src/commands/config/context/add.ts:8:7
    8 const Context_1 = require("../../../models/Context");
            ~~~~~~~~~
    'Context_1' was also declared here.

module<EMAIL_ADDRESS>task: toCached
plugin: @asyncapi/cli
root: D:\Programs\AsyncAPI\cli
See more details with DEBUG=*
All in one CLI for all AsyncAPI tools

VERSION
  @asyncapi/cli/0.14.1 win32-x64 node-v16.13.0

USAGE
  $ asyncapi [COMMAND]

COMMANDS
  config    access configs
  diff      find diff between two asyncapi files
  generate  Generator is a tool that you can use to generate whatever you want basing on the AsyncAPI specification file as an input.
  new       creates a new asyncapi file
  start     starts a new local instance of Studio
  validate  validate asyncapi file

PS D:\Programs\AsyncAPI\cli>

These warnings are coming from here
const generator = new Generator(template, flags.output || path.resolve(os.tmpdir(), 'asyncapi-generator'), {
  forceWrite: flags['force-write'],
  install: flags.install,
  debug: flags.debug,
  templateParams: params,
  noOverwriteGlobs: flags['no-overwrite'],
  mapBaseUrlToFolder: flags['map-base-url'],
  disableHooks,
  mapBaseURLToFolder
});
await generator.generateFomString(asyncapi.text());

To be precise it breaks in when I create a new Generator object. I am trying to follow this, but maybe I am missing something.

@Souvikns I will check that but as I remember we had similar issue in the server-api project and I changed the imports to fix them. It's a problem with TS/TS-node, not with generator package.

https://github.com/asyncapi/generator/blob/1359f15a99a72f58380249b489bded4c29d0e978/package.json#L76-L77
@magicmatatjahu why does generator has ts-node and typescript as dependencies also why does it need typescript when it is a js project?

Found https://github.com/TypeStrong/ts-node/issues/883 is this relevant in our case.

@magicmatatjahu I tried ignoring the import but I am getting the same errors.

The tests are running in my local setup 😞

@magicmatatjahu, @derberg generator command is ready for review. I have added a spinner as per https://github.com/asyncapi/cli/issues/9#issuecomment-1081950527, I want some opinion on that.

I'm not gonna do code review as I see @magicmatatjahu already did it. Just let me know when is the right time to do user testing on local. Happy to help and check DX

I am getting this message when running asyncapi --help
=============================================
simple-git has supported promises / async await since version 2.6.0.
 Importing from 'simple-git/promise' has been deprecated and will be
 removed by July 2022.

To upgrade, change all 'simple-git/promise' imports to just 'simple-git'
=============================================

CLI is not using simple-git, but maybe a tool we depend on is using it.

@Souvikns generator has simple-git as dependency

@derberg We know, in the PR we used old version of generator, but after bumping the issue should be resolved :)

Yeah, I have bumped the generator version, pr is ready for review now.

I definitely want to do DX manual testing, gimme few days 🙏🏼

@derberg No problem, however remember that now we don't have implemented --watch-template functionality in this PR.
@Souvikns If you want, I can help you with it :)

Oh sorry, I was kinda confused about how the CLI's watcher is working https://github.com/asyncapi/cli/blob/b0cd740a6b405c04c092345c1db02097ee53c47c/src/globals.ts#L28, I will give another try, give me some time on this.

@Souvikns If you want, I can help you with it :)

Thanks @magicmatatjahu I will ask you if get stuck.

The watcher is not working correctly.
Getting this error
➜ ./bin/run generate https://bit.ly/asyncapi @asyncapi/html-template --output ./docs -w
Error: Cannot find module<EMAIL_ADDRESS>Require stack:
- /Users/postman/Documents/GitHub/cli/lib/commands/generate.js
-<EMAIL_ADDRESS>-<EMAIL_ADDRESS>-<EMAIL_ADDRESS>-<EMAIL_ADDRESS>-<EMAIL_ADDRESS>-<EMAIL_ADDRESS>- /Users/postman/Documents/GitHub/cli/bin/run

@magicmatatjahu need your help here.

Thanks, to @magicmatatjahu implementation, is ready, @derberg I think you can do manual tests now.

@derberg

I think you folks saw https://github.com/asyncapi/cli/pull/173 and are aware of the direction that we were going there with generate command. With generate types. Shouldn't we merge the other PR first and add this PR with generate template ?

We can even add generate template in this PR and then handle mentioned PR. What do you think?

in code I see custom handling of file vs url, and in help message no mention of context which makes me feel we are not reusing global handlers for handling file/url/context, which is not good

Where do you see that?

😆 sorry, we are using the load function here. Then @derberg shall we just move the command under generate template?

We can even add generate template in this PR and then handle mentioned PR. What do you think?
Then @derberg shall we just move the command under generate template?

to be fair with contributor, we should first merge modelina, and then this 😉 unless he is ok with your suggestion.

sorry, we are using the load function here

oh sorry, I noticed https://github.com/asyncapi/cli/pull/221/files#diff-8a64c17c2ac6b0f75d2c565e975631f3c831a8eb5b0aa22eaa4cfda960b08920R8-R10 but did not check if you are using it 😞 sorry, please remove this helper
also please update help to make it clear that asyncapi argument can also be context

to be fair with contributor, we should first merge modelina, and then this 😉 unless he is ok with your suggestion.

Sure @derberg I have no problem waiting, let's merge this after we have merged modelina.

can you please fix some DX with your PR in the new asyncapi generate command?
$ asyncapi generate
 ›   Warning: help is not a asyncapi command.
Did you mean new? [y/n]: n

☝🏼 should actually work the way that I out of the box get a display of help message with list of commands available in generate topic
$ asyncapi generate
Generates typed models

USAGE
  $ asyncapi generate COMMAND

COMMANDS
  generate models  Generates typed models

Yeah, it does not support out of the box for topic, I forgot to add the workaround for the generate command.
cli on  generator-command is 📦 v0.21.0 via ⬢ v16.14.0
➜ ./bin/run generate
Generate typed models or templates

USAGE
  $ asyncapi generate

DESCRIPTION
  Generate typed models or templates

COMMANDS
  generate models    Generates typed models
  generate template  generate whatever you want using templates compatible with AsyncAPI Generator

cli on  generator-command is 📦 v0.21.0 via ⬢ v16.14.0 took 4s
➜

@Souvikns you have some conflicts with package-lock.json. Lemme know when we can do the review

@derberg it is ready for review 👍🏼

@Souvikns is there any other way we can test them? We need to increase 🤷🏼

I'm thinking if asyncapi generate template is not confusing:

asyncapi generate models actually generates models
asyncapi generate relations (or whatever name will be when integrating cupid) actually generates a relations diagram
asyncapi generate template is actually not generating a template 😄 so maybe asyncapi generate fromTemplate?

@Souvikns is there any other way we can test them? We need to increase 🤷🏼

Increasing the timeout works couldn't find anything else, maybe we try to reduce the time it takes for generation 🤷🏼♂. Will add more tests if increasing the timeout is alright.

asyncapi generate template is actually not generating a template 😄 so maybe asyncapi generate fromTemplate?

Yeah makes sense we can have fromTemplate what do you think @magicmatatjahu

-o flag is mandatory, and like in case of other generate commands, it should not, yes, I understand it is not in the generator. It should be contributed as now the DX is not cool, that I get error about missing arguments when running asyncapi generate template, and then when I add missing arguments I get error about missing flags, and flags should not be mandatory

This was a change requested by @magicmatatjahu https://github.com/asyncapi/cli/pull/221#discussion_r865802887 so we should ask him. Should we revert -o to not be required flag. Also, we can make asyncapi file path not required as we can use load function to pick up from working directory or current context, but template arg should be required.
cc: @magicmatatjahu @derberg

@derberg can you help me, tests are failing in the windows even though they were running on other platforms, and also sonarcloud is picking up code smells from minimaltemplate I added the sonar-project.properties but it is still not excluding the folder.

@magicmatatjahu if we commit __transpiled for test template, will it speed up tests run? I think you told me recently that no.
@Souvikns regarding exclusions from sonar, try removing spaces and using wildcards like in this example -> https://github.com/asyncapi/generator/blob/master/.sonarcloud.properties#L2

@derberg No, generator will try transpile it again.

@Souvikns so yeah, add transpiled dir to git ignore

I ran the the tests in my windows computer and there generate template command is missing, which is wierd
(node:16620) [MODULE_NOT_FOUND] ModuleLoadError Plugin: @asyncapi/cli: [MODULE_NOT_FOUND] require failed
to load D:\Programs\Asyncapi\cli\lib\commands\generate\template.js: Cannot find module<EMAIL_ADDRESS>Please verify that the package.json has a valid "main" entry
module<EMAIL_ADDRESS>task: toCached
plugin: @asyncapi/cli
root: D:\Programs\Asyncapi\cli
See more details with DEBUG=*
(Use `node --trace-warnings ...` to show where the warning was created)
 »   Error: Command generate:template not found.

Also something related to fs-extra @magicmatatjahu do I need to udpate the @asyncapi/generator

@Souvikns yo, I'm back, you need help? I noticed you reverted minimaltemplate from using it in test

Yeah, tests were failing in windows, after some testing on windows, I found out that the generator command does not work in windows when we are using local template and it throws this error
Error: EISDIR: illegal operation on a directory, symlink 'D:\Programs\Asyncapi\cli\test\minimaltemplate'
-> 'D:\Programs\Asyncapi\cli\node_modules\@asyncapi\generator\node_modules\undefined

hmmm, maybe we actually need a name in package.json? this undefined made me think about it. Give it a try

Even after adding the name parameter I still get the same error,After https://superuser.com/questions/1031213/windows-10-symbolic-links-problems I tried to run in adminitrator command prompt and then it ran, So it is clearly some issue with rights,

@Souvikns just to be 100% sure, windows tests are failing on both your local and GH Actions? and it is fixable only if on local you run as Admin?

Yeah

There are always issues with windows... 😞
I'm confused because when you do npm install of a package that is on a disk, symlinks are created only if the folder is outside the project where the npm install is ran. In other words, cli is a folder where @asyncapi/generator is installed under node_modules and therefore dependencies of minimaltemplate should be located there as well.

If  sits inside the root of your project, its dependencies will be installed and may be hoisted to the top-level node_modules as they would for other types of dependencies. If  sits outside the root of your project, npm will not install the package dependencies in the directory , but it will create a symlink to

So symlink, in this case, should not even be created by npm 😞 or I'm missing something 🤷🏼

So symlink, in this case, should not even be created by npm 😞 or I'm missing something 🤷🏼

Since it is not in our package.json I think npm is not creating any symlink.
I think https://www.npmjs.com/package/@npmcli/arborist is installing simpletemplate as a dev dependency to @asyncapi/generator but windows is not allowing it to do that.

@Souvikns maybe we can work around it by adding a name to the template like @asyncapi/minimaltemplate and in cli add it as devDependency, and point to ./test/minimaltemplate - this way it is 💯 installed in node_modules 🤔 can you give it a try?

@Souvikns maybe we can work around it by adding a name to the template like @asyncapi/minimaltemplate and in cli add it as devDependency, and point to ./test/minimaltemplate - this way it is 💯 installed in node_modules 🤔 can you give it a try?

Yeah now it works in my computer

Yeah you can review 👍🏼

I'm reviewing after the holidays, so my memory might be wrong 😅  sorry 🙏🏼

as far as I remember we agreed template to be fromTemplate
I think I left a comment about error handling, that we should not propagate errors from the generator, but wrap ours around. We should not mix CLI and Generator errors$ bin/run generate template test/asyncapi.yml @asyncapi/html-template
Generation in progress. Keep calm and wait a bit... done
Something went wrong:
Error: "/Users/wookiee/sources/cli" is in a git repository with unstaged changes. Please commit your changes before proceeding or add proper directory to .gitignore file. You can also use the --force-write flag to skip this rule (not recommended).
    at Generator.verifyTargetDir (/Users/wookiee/sources/cli/node_modules/@asyncapi/generator/lib/generator.js:846:71)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Generator.generate (/Users/wookiee/sources/cli/node_modules/@asyncapi/generator/lib/generator.js:173:29)
    at Template.generate (/Users/wookiee/sources/cli/lib/commands/generate/template.js:122:13)
    at Template.run (/Users/wookiee/sources/cli/lib/commands/generate/template.js:37:13)
    at Template._run (/Users/wookiee/sources/cli/node_modules/@oclif/core/lib/command.js:67:22)
    at Config.runCommand (/Users/wookiee/sources/cli/node_modules/@oclif/core/lib/config/config.js:268:25)
    at Object.run (/Users/wookiee/sources/cli/node_modules/@oclif/core/lib/main.js:78:5)
Error: EEXIT: 1

Now we have output optional, but we are generating files to workdir. We do not put content in terminal. I'm ok to accept such behavior as this is current generator CLI behavior and as thanks to force-write nobody can harm themselves by overwriting their work with generation. I'm aware that Generator does not support generation in the way that we could use it to render results to the terminal. The only possible solution would be to use tmpdir() and by default, generate files there and then read them to the terminal, but yeah, I'm not so sure. Can you just create a follow-up issue in the Generator, to enable what we need?
In Help in terminal, all help description should start with upper case
We should have a test for every flag, and also test bad flag usage and ensuring that proper error is rendered
In regards to disable-hook:

we do not have a test
I tried to check how it works and I failed, looks like it never works

In regards to params

we need test with 2 params provided
it is also confusing that current test uses flag -p=customParam=\'1.0.0\' and it works, but -p customParam=\'1.0.0\' works to. I tried with nodejs-template -p server=production asyncapiFileDir=my and was great, and could not figure how to do it if it starts with -p=. That was not intuitive. We need to be consistent, support one way or two, as long as help is consistent. Now even help says something different if you compare it with this error message https://github.com/asyncapi/cli/pull/221/files#diff-1d6320fe12a9862589159673bb610b4cd3e8d5cfaf471e29c3a7fc6fce5cf9d8R127

In regards to map-base-url I did not check it as I assume problems I described above are related to all flags that require custom input parser
We need some examples when running asyncapi generate fromTempate --help, complex examples with multiple flags used, and when explaining each flag, example of a flag.
I was thinking about how we can ensure better in tests that the given flag was applied and works. Now in tests, you only evaluate that a successful message got into stdout. Maybe we are missing unit tests for flags parsers (look at my issues with flags like params) and unit tests that make sure the given function was invoked with proper values 🤔 . Or we need integration tests: so basically evaluate also if generated file/dir contains (or not) content, based on the selected flag. I'm not sure what is the best approach here. Thoughts?

Sorry 😅
I'm happy to hop on a call if you need some help

I am trying to check if the flag parsing is working and I think it is working as expected
./bin/run generate fromTemplate s s -d generate:before=foo,bar generate:after --map-base-url https://schema.example.com/crm/:./test/docs/ -p version=1.0.0 name=souvik

{
  params: { version: '1.0.0', name: 'souvik' },
  disableHooks: { 'generate:before': [ 'foo', 'bar' ], 'generate:after': true },
  mapBaseUrlToFolder: {
    url: 'https://schema.example.com/crm',
    folder: '/Users/postman/Documents/GitHub/cli/test/docs'
  }
}

@derberg can you share how you are testing disable-hook flag

I found something about map-base-url flag, for some reason generateFromString command does not support map-base-url and which is something we are using because we are using CLI's load function for loading the spec file, so currently map-base-url flag does not work at all. What should we do, not use our CLI's load function?

Ah yes, cause we are not using generateFromURL as there is no point in doing it as we have our own load.
I think we should be consistent and use our own load function.
There are 2 options:

you just take https://github.com/asyncapi/generator/blob/master/lib/generator.js#L326-L328 and move it to generateFromString. I don't see a problem with it. In the end, somebody consciously passes mapBaseUrlToFolder to the constructor, so they know what they're doing 🤷🏼 and now the current solution limits/forces them to use generateFromURL 🤔
you can just make CLI responsible for getMapBaseUrlToFolderResolver, not rely on generator 🤔

I am struggling to solve this, generator does not have any errors that I can extend, one thing we can do is match output string and create our own errors and use them, or should we wait for https://github.com/asyncapi/community/issues/266
@derberg what do your think?

yeah it will take some time until it is actually used in the generator. one thing we can do is match output string and create our own errors and use them is a good option, we just need to have some meaningful fallback, in case error strings change 😄
@magicmatatjahu @boyney123 any thoughts on above challenges?

you can just make CLI responsible for getMapBaseUrlToFolderResolver, not rely on generator 🤔

@derberg I went with this and also removed the stack from the output so now the error messages look something like this

The messages coming from the generator commands are self explanatory so I didn't changed anything, can you review and let me know if any thing needs to be changed.

/rtm


For #6: adding 0pdd support.

For #6: adding 0pdd support.

@rultor merge

@rultor merge

@paulodamaso OK, I'll try to merge now. You can check the progress of the merge here

@rultor merge

@paulodamaso Done! FYI, the full log is here (took me 3min)

Codecov Report

Merging #12 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             master    #12   +/-   ##
=======================================
  Coverage       100%   100%
  Complexity       54     54
=======================================
  Files            27     27
  Lines           171    171
=======================================
  Hits            171    171

Continue to review full report at Codecov.

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


feat: Add Protocol for API objects

Fixes some type errors that have been seen by users and in other internal code. Also makes some methods public that were being used by QuantinuumBackend and fixes some mismatched types.
Description
This is a bit of a drive by PR, but this type issue was noticed by some users recently and is also an issue in some internal code. It looks like there were also some interface differences that adding this protocol raised. Possibly needs a bit more review as there may be some API changes that require a version bump.
Related issues
Please mention any github issues addressed by this PR.
Checklist

[x] I have performed a self-review of my code.
[ ] I have commented hard-to-understand parts of my code.
[ ] I have made corresponding changes to the public API documentation.
[ ] I have added tests that prove my fix is effective or that my feature works.
[ ] I have updated the changelog with any user-facing changes.

Please rebase and retarget to main which is now the default branch.


adds preload prop (refactors CardImage props), enables on index and projects pages

By default, Next lazy-loads all images; this PR lets us manually toggle that through the ProjectCard component, and then applies that on components we deem that are going to be above the fold.

It's still pretty slow haha, did you want this to tackle the preload issue or also the loading?

Oop sorry, slipped through the notifs. Does this not tackle the preload issue? Seems like the image network request is made on first read now, but I might've misconfigured it.


Clean up inconsistency page

Changes in this PR:

Do no display payload inconsistency if it doesn't exist
If a user directly goes to the inconsistency page, load the streams from cluster if the variable is empty

One case that I'm not sure of is whether payload inconsistencies can exist without assembly inconsistencies?


WinUI 3.0 Support

Understanding it is still in preview and not to be released until November 2020 with .NET 5, but wondering if there were plans to create a WinUI version for HexEditorControl?  BTW... nice control 👍

I will check this when is possible but it's a nice idea :smile:

@abbaye thx 👍

Your welcome !


vue-devtools can't work well in chrome 62.0

I use vue-devtools to view store, it works well before, but after updating chrome, I find it doesn't work well any more,

I find it doesn't work well any more,

What is that supposed to mean?

Make sure to open the devtools after the page with Vue is opened.
Devtools are working fine with latest Chrome. You may want to ask for some help over the forum or the Discord server, but I recommend you giving more details 😉 . Make your bundle is non-minified and doesn't have the option Vue.config.devtools to false


Update README.md

Updated size of string from 10KB to 20KB according to

Note: Strings are stored as UTF-16 characters in .NET so each char takes two bytes in memory.

but also after running
Console.WriteLine(
    System.Text.Encoding.Unicode.GetByteCount(
        new String('x', 10 * 1024)));

// Answer: 20480

Also created https://github.com/dotnet/AspNetCore.Docs/pull/33937


RouxError does not implement std::error::Error

This prohibits using it with anyhow and other erased error types like Box<dyn Error>

Thanks for pointing this out. Fixed in fca5452a15dc244c920a165b544b8e09fdc3b7ac.


Custom names for plural queries

Is your feature request related to a problem? Please describe.
AppSync automatically adds an 's' at the end of a model name when it is a plural query, meaning if you have a model called User then the list query for that model will be listUsers which is good. But if you have a model named Business or Person then the list query will be listBusinesss or listPersons which is grammatically incorrect.
Describe the solution you'd like
Maybe have a larger database for storing singular-plural names or let the user customize the name of the query, because if I enter this in my schema file -
type Query {
  listBusinesses: [Business]
}

then it will display an error saying that it is trying to overwrite a query. I can go into the AWS AppSync console and manually change that but then I will have to do that every time I push.
Describe alternatives you've considered
I don't have any alternatives
Additional context

To piggy-back on this, acronyms and initialisms for type names get mangled for the auto-generated connection indexes. 'GCHQ' type with a 'site' connection parameter becomes gCHQSiteId.

I am currently facing this when I trying to generate Address. It generates ie listAddresss instead of listAddresses.

I'm bumping into this with a type of Company. My kingdom for listCompanies instead of listCompanys.

@lseemann you can change the name of the generated list query inside of the model directive.

That would be amazing. What's the correct syntax for that? I've not been able to find anything in the docs.

@lseemann see here:
https://docs.amplify.aws/cli/graphql-transformer/model

So it is. I wish the docs were more explicit, but it appears the following does the trick:
type Company
  @model(
    queries: { get: "getCompany", list: "listCompanies" }
  )
 ...
}

Thank you!

I'm going to close this as it has been implemented in a few ways (by default in v2 of the transformer, via the improvepluralization feature flag in v1, and manual override as described in the previous comment).


HTTP Response message

Hi,
This cookbook is working really well for now :)
One thing though, can we add another attribute that enables access to the HTTP response message. I can see we get the response code, but the response message often contains useful info.
It might already be there, but I can't see how to get to it.
Actually, thinking about this some more it might be useful to have both of theses:
default["webhooks"]["response_code"]
default["webhooks"]["response_message"]

If you access it via the Library you'll get the entire response back.  For use in a Recipe, I can add this, no problem.

Thanks. I'm still using recipes at the moment so adding it will be much appreciated:)
Sent from my iPhone

On 12 Mar 2015, at 06:58, Brian Stajkowski<EMAIL_ADDRESS>wrote:
If you access it via the Library you'll get the entire response back. For use in a Recipe, I can add this, no problem.
—
Reply to this email directly or view it on GitHub.

Added in 0.2.0. Enjoy!

Worked perfectly - thanks for doing this.
Sent from my iPhone

On 13 Mar 2015, at 03:52, Brian Stajkowski<EMAIL_ADDRESS>wrote:
Added in 0.2.0. Enjoy!
—
Reply to this email directly or view it on GitHub.


Add support for Route Segment Config for Layouts and Pages

Add support for Route Segment Config for Layouts and Pages:
export const dynamic = 'auto'
export const dynamicParams = true
export const revalidate = false
export const fetchCache = 'auto'
export const runtime = 'nodejs'
export const preferredRegion = 'auto'

Good to know: The values of the config options currently need be statically analyzable. For example revalidate = 600 is valid, but revalidate = 60 * 10 is not.
See: https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config

Hi @svobik7, I noticed that Route Segment Config is not supported yet. The functionality is added in the linked PR.

Good job! Thank you 🙂


Decrease fund-ring-widget.js file size

Summary
I haven't explored this in depth yet and it may be tricky given the amount of libraries and styles used in the component, but I want to experiment with some things in the vite.widget.config.ts to reduce the bundle size.
Update: it looks like the css imported into the widget from tailwind/daisy is increasing the bundle size by almost 70%, so stripping those out and just using raw CSS may be a good first step
Motivation
Smaller file size is better 🤷🏼

I'm going to keep this issue open for now because I think it would be good to address this at some point, so we have a template to use if we want to apply this same approach to another one of our projects at some point


Remove unnecessary commented out code

This commented out code was introduced 3 years ago. Most likely it was copy-pasted from some other place back then. Anyway, I don't see why these 2 commented lines need to live in this file.

:+1: Thank you!


PLAT-64255: Optimize ExpandableItem render performance

Checklist

[x] I have read and understand the contribution guide

[x] A CHANGELOG entry is included

[ ] At least one test case is included for this feature or bug fix

[x] Documentation was added or is not needed

[ ] This is an API breaking change

Issue Resolved / Feature Added
ExpandableItem performs an additional update/render after mounting due to its use of Transition - which performs an idle job in order to render its children. This behavior is generally ideal in that it optimizes mount time initially. However when used in views (Panel), it can block animations and result in longer transition time between panels.
Resolution
We can utilize ExpandableSpotlightDecorator to only mount the transition container when it becomes focused (to prepare for the assumed next open state) or when specifically toggled open. When performing this via a job, we can prevent this transition container rendering when simply moving a pointer over & out of an ExpandableItem - where we weren't expecting to open the expandable - saving us the trouble of needlessly rendering.

I meant to open this as a draft PR (if it even matters) - but I'd like to discuss whether we think this is the right general approach for the perf mounting issue.
I notice that tests are failing with this change - although it's not immediately clear to me why. But I can clean that up as we progress this ticket.

Due to the nature of handling child container rendering in ExpandableSpotlightDecorator, it will be necessary to use and test against the full version of our expandable components, rather than the base components when testing contained children. As far as I know, we're expecting developers to use the full component so I don't believe this is a breaking change, but correct me if I'm wrong.
That being the case, I've updated the tests to reflect this behavior. In the case of DatePicker and TimePicker, the full component also uses i18n, which alters some of the expected results.

It was a bit weird that we were mount()-ing base components anyways so not too concerned about the test changes.

Code looks sound to me. I won't have time to test in detail before EOD so I'm going to defer merging for now.


distance popup window annoyance

Hello,
a comment on the distance popup window: I find this quite annoying. It pops up at the place where a route was just modified and therefore obscures exactly the place where one would be most interested in seeing additional points or the map, or to see the new route. I also do not see much added value from the popup in the middle of the map. It could well be placed at another location of the GUI.
Best wishes
Christian

Hey @shinkolobwe
Thanks for your feedback.
The route distance and duration popup is necessary to show a summary of the route to the user. It can be closed and then the user will be able inspect any map detail. It also provides the profile that is being used (via icon).
You have to consider that there are many possible scenarios:

users on mobile devices or low resolution will not have the side bar open by default. So if they use context actions to calculate a route, they will not have the basic information about the route.
Another case is when the app URL (with a route calculated) is shared and the route was not defined by the user who is viewing it. In this case the essential info about the route must be clear: profile, distance and duration.

We use leaflet and the polyline popup to show the route details, so it makes sense that the details are visually linked to the element (route polyline) drawn on the map and not in another location. Although it is not determining, I could also argue that other commercial map clients also show this route summary popup. So we assume the users are already used to it.
I appreciate your comments and willing to contribute, but in this case we will keep it. Maybe if more users support your point then we can reevaluate it in the near future.
Best wishes
Amon

Hi Amon
perhaps you can agree that the route shown in the attachment is pretty hidden, not what the average user would desire from the software or the service. I think with all the background efforts, you are damaging quite a lot of utility here, without any real necessity to do so. The popup can be placed at another location, distant from the route, without losing anything.
Best wishes
Christian