Removed uncessary channel crushing

Calling set_channels(1) already converts the audio to one channel, so there was no need to call split_to_mono, instead we can just call get_array_of_samples```
This should have a negligible positive impact on performance. Can someone test this quickly for me? I'm not in a position to test at the moment.

@abdeladim-s Please review this. In the meantime I'm going to write a helper script to auto convert various types of files into something whisper can accept.

The script looks nice, but if I understand it correctly, it's similar to what I am already doing!
There is no need to convert the files to wav as we are calling the cpp functions directly, not calling whisper.cpp using the CLI.
Numpy array of the audio file is what we need.

The script looks nice, but if I understand it correctly, it's similar to what I am already doing!
There is no need to convert the files to wav as we are calling the cpp functions directly, not calling whisper.cpp using the CLI.
Numpy array of the audio file is what we need.

No I know. But my understanding is you're doing some pre processing pre transcription.
I want to do all the pre processing on large batches of data while transcription is actively happening to remove one more task from the processing pipeline.
Also, if I'm understanding correctly, you're not actually converting it to 16bit files and that may harm transcription.
I'll look over it again, but I also want to remove the need to convert the wav files to numpy arrays before transcribing.
That would help with performance. At least according to my CPython internals book that recommends a lot of things to avoid.
I'm aiming to make the slowest part loading the model into memory. And even then, I want to explore making it '''deepcopy''' able so we can load the model, clone it in memory, and change its settings as needed from the defaults by using copy.deepcopy.
This way multiple instances can be loaded 100% independent of each other vs the current situation with static methods.
I explored making everything not static and deep copy friendly but ran into some issues with PyBind11.
It's late here, so I might have to advise on that front tomorrow.

Yes,  pre processing is necessary to make every type of media compatible with whisper.cpp

The files need to be converted to 16Khz mono, similar to what you did in the script, it's actually here

If you removed the conversion to numpy array, how you are going to pass the data to c++ ?

Other than that, good luck with your exploration, the code is yours .. looking forward it :smile:
I can merge this for now if you want ?

Yes,  pre processing is necessary to make every type of media compatible with whisper.cpp
The files need to be converted to 16Khz mono, similar to what you did in the script, it's actually here
If you removed the conversion to numpy array, how you are going to pass the data to c++ ?

Other than that, good luck with your exploration, the code is yours .. looking forward it 😄
I can merge this for now if you want ?

Yea please do!
As for how we would load them, we could re-initialize the numpy.ndarrays I guess and pass them along to the C++ interface? I'm struggling to explain it. I need to write some code to show it. Also I was confused why the code wasn't updated, just saw you merge it.

 Take your time!
Looking forward your futur PRs.
I'll merge this one for now!
Thanks for the contribution :smile:


Update template for 1.0

Hi @Neon22,
the extension template needs to be updated for Inkscape 1.0 .
More info is available here:
https://wiki.inkscape.org/wiki/index.php/Release_notes/1.0#For_extension_writers
As this is universally useful to new extension authors, if you have a GitLab account, it could maybe be useful to contact Martin / doctormo in the extensions repository bug tracker, to see how to make it easier to find, and to have help with updating and including the new features (we can do images and links now, for example :) ).

Yes I'm planning on getting back to this soon. Its summer down here now
:)
Merry Xmas BTW.
I'll be developing in windoze alas and will have to find a suitable
download.
Thanks, Mark...
On 2019-12-11 13:00, Moini wrote:

Hi @Neon22 [1],
the extension template needs to be updated for Inkscape 1.0 .
More info is available here:
https://wiki.inkscape.org/wiki/index.php/Release_notes/1.0#For_extension_writers
As this is universally useful to new extension authors, if you have a
GitLab account, it could maybe be useful to contact Martin / doctormo
in the extensions repository bug tracker [2], to see how to make it
easier to find, and to have help with updating and including the new
features (we can do images and links now, for example :) ).
--
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub [3], or unsubscribe
[4].
Links:
[1] https://github.com/Neon22
[2] https://gitlab.com/inkscape/extensions/issues
[3]
https://github.com/Neon22/inkscape_extension_template/issues/7?email_source=notifications&email_token=AAG3SGZOET7TWEOAFXBTYALQYAURHA5CNFSM4JZGROC2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H7TVMYQ
[4]
https://github.com/notifications/unsubscribe-auth/AAG3SGYBXTVSAD5ORSKPAH3QYAURHANCNFSM4JZGROCQ

Fortunately, finding an Inkscape program file for Windows isn't an issue anymore - they're auto-built via CI now. The latest ones are linked from https://inkscape.org/release/inkscape-1.0/?latest=1 (updated continuously, or at least once a day).
When I made this report, I forgot that I had an example inx file for some of the new features, maybe that'll help:
https://gitlab.com/Moini/ink1.0talk/blob/master/demo_new_extension_layout.inx
The Python part, however, has changed a bit more ...
Have a good Christmas time, too :)

@doctormo has now removed the link to this example repo from the website's extension development page. It's still a valuable info source, so please let us know when you update it, so we can check if it should be linked again to help new extension devs.
Hope all is well for you! :kiwi_fruit:


User can see the diagram as a SOQL query

Prototype the idea that this can be used as a query builder to reach a wider audience.
It will need the user to pick the "from" entity from the list of visible entities.

duplicate


[All commits ever since init] Silver nitrate to bacteria zombie effect

Finished model. Fined tuned in terms of agent based observability, only left is to fine tune the model in terms of the experiment's chemical boundaries as with our main reference cited in our README.md on this branch.
Closed the first pull request due to an update in the verification files.

All commits are submitted by me, as my partner and I work on the code simultaneously irl.


Update Github Actions to build on both Java 11 and 16

Also bumped the cache action to version 2.1.4

Closes #49

@dependabot rebase


Elastic Search Docs - Add information about required permissions for Mattermost service account

Summary
Following the discussion in the issue and also on the Mattermost Hacktoberfest channel, it was decided to add another section to the Elasticsearch section of the documentation about the required permissions necessary for Mattermost.
This PR's aim is to address this by adding a description of the use case and relevant JSON examples of how those permissions look like.
Ticket Link
Fixes #3992

Hello @TomerPacific,
Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

@TomerPacific this is great... thanks so much!
I suggested 2 slight edits to make it generic to any customer (the string i replace are specific to a certain customer).
Feel free to adapt my edits to be more idiomatic for our docs when it comes to a variable subsitution.
@cwarnermm  - One thing to note, I don't see the json strings in the edit when I view on the preview environment.  Not sure if that's expected based on the markup used?

@sadohert - thanks for the feedback. I also saw the code blocks not being generated, so I made a revision, but that was after the previous commit was uploaded to a preview environment. Hopefully my changes fixed this.

@sadohert - thanks for the feedback. I also saw the code blocks not being generated, so I made a revision, but that was after the previous commit was uploaded to a preview environment. Hopefully my changes fixed this.

Thanks!  I'm still not seeing the json in the latest preview environment - http://mattermost-docs-preview-pulls.s3-website-us-east-1.amazonaws.com/6732
Are you saying another commit is coming?

I too am not seeing the code blocks and am currently investigating.

Thank you both @sadohert and @cwarnermm. I'll correct the indentation.


feat: better trimming of an error trace string

This change is

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

Project coverage is 73.05%. Comparing base (a6aa9a9) to head (95de865).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1689      +/-   ##
==========================================
+ Coverage   73.03%   73.05%   +0.01%
==========================================
  Files          59       59
  Lines        8742     8748       +6
  Branches     8742     8748       +6
==========================================
+ Hits         6385     6391       +6
  Misses       1873     1873
  Partials      484      484

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


Enhancement: For people like me, add a way to make mods through source too since some people dont like using the mods menu

Please check for duplicates or similar issues before creating this issue.
What is your suggestion, and why should it be implemented?
For people like me, add a way to make mods through source too since some people dont like using the mods menu

bruh just edit the source code

doesnt work

or its a pain

L

lol


Make Fresnel darken SSR instead of blending with specular

This PR fixes (partially) #79549 due to Fresnel incorrectly blending SSR with specular, but only if fade in and fade out are set to 0.0.
Without fade in/fade out, the reflections are fully opaque and look correct.
This PR with fade in and fade out set to 0.0:

To avoid specular light blending/passing through SSR reflections, we cannot allow the alpha value of final_color in the SSR shader to drop below 1.0.
Now fade in/fade out introduces blending with specular light. Because the sun in the HDR image is so strong (the brightest sun pixel is RGB(41184.0, 35776.0, 28624.0) compared to around RGB(0.4, 0.4, 0.4) in the SSR reflection), even mixing just a bit of specular light with SSR causes a significant change in color and produces bad results.
This PR with fade in 0.001 and fade out 0.0:

Not sure how we can fix/if we should fix the fade mixing. Maybe there is a better way to mix HDR values than glsl mix() in specular_merge.glsl.

Now fade in/fade out introduces blending with specular light. Because the sun in the HDR image is so strong (the brightest sun pixel is RGB(41184.0, 35776.0, 28624.0) compared to around RGB(0.4, 0.4, 0.4) in the SSR reflection), even mixing just a bit of specular light with SSR causes a significant change in color and produces bad results.

There is a Clamp HDR Exposure import option that should be enabled on the panorama texture in the Import dock.

The final step before merging is to squash all the commits together so that the whole PR only contains 1 big commit with all your changes. We like to merge one commit at a time to keep the git history clean and navigable.
If you don't know how to do that, we have a helpful tutorial in the official documentation https://docs.godotengine.org/en/latest/community/contributing/pr_workflow.html#the-interactive-rebase

The final step before merging is to squash all the commits together so that the whole PR only contains 1 big commit with all your changes. We like to merge one commit at a time to keep the git history clean and navigable.
If you don't know how to do that, we have a helpful tutorial in the official documentation docs.godotengine.org/en/latest/community/contributing/pr_workflow.html#the-interactive-rebase

Ping @mandryskowski - are you able to do this update?

So my first rebase attempt went catastrophically and for a second I managed to get my branch 1000 commits ahead of godot/master which led up to me requesting a review from 32 different godot teams.
Sorry for that. I believe I managed to squash correctly at the end, my branch is 1 commit ahead.

Thanks!


Java8 Maven support

Java8 Template Maven support
Expected Behaviour
Observed that default Java 8 template has no support for Maven, hence enabled Maven support on Java8 as part of the project requirement
As most of the companies / Projects are still mavenized would like to share the code snippet for Java8 Maven template
Current Behaviour
Currently there is no Maven support for existing Java8 template
Possible Solution
Provided Maven support to Java8 template along with mavenized build
Steps to Reproduce (for bugs)
Currently there is no support for Maven
Context
As most of our projects still on Maven we wanted to find a way to run openfaas with Maven builds, as there is out of box support for Maven enhanced the project to support both Maven and Gradle
Your Environment

Docker version docker version (e.g. Docker 17.0.05 ):

Are you using Docker Swarm or Kubernetes (FaaS-netes)?
DockerSwarm

Operating System and version (e.g. Linux, Windows, MacOS):
Linux

Link to your project or a code example to reproduce issue:

Hi thank you for stopping by and showing and interest in OpenFaaS.
Can you introduce yourself please? When you say "we", who is that?
For Maven I think requesting a template is reasonable, but it's more likely to be for the Java 11 templates. Is there any reason you're not asking about that? Isn't Java 8 EoL?

Thanks for quick reply @alexellis
I am Gopi, I am Technical Manager in Optum Global Services.  As part of Serverless migration from other serverless framework to Openfaas, I have done PoC on Openfaas.  Part of the PoC identified that out of box there is no Maven support for Java Template.  So implemented the logic to enable Maven support for Java8 template.
As you rightly mentioned we are moving to Adoptive OpenJDK 11 and will be enabling Mavenization for Java 11 template.
As we already have the maven for Java 8, I don't think it will be more effort to enable Maven for Java 11


Update publish.md

Proposed changes

Unreleased project version (optional)

Related issues (optional)

Thanks, @scjane !


InvalidOperationException using 'EnableEncryption'

Hi, excellent work, I'm using it without any problem, except when use "EnableEncryption" (and his password) in a medium database (about 42 226 KB), if I put "EnableEncryption" false all the prosess finish without troubles, if my database is shorter the problem still persist
the error is:
Collection was modified; enumeration operation may not execute
Source:
mscorlib
Stack trace:
   en System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)     en System.Collections.Generic.List'1.Enumerator.MoveNextRare()     en MySql.Data.MySqlClient.MySqlBackup.Export_Procedures()     en MySql.Data.MySqlClient.MySqlBackup.ExportStart()     en MySql.Data.MySqlClient.MySqlBackup.ExportToFile(String filePath)     en AppName.ControlDatosExternosClass.<>c__DisplayClass21_0.<CopiaRespaldoDB>b__0(Object   s, DoWorkEventArgs args) en D:\RouteToTheFile\ControlDatosExternosClass.cs:línea 757
And the line 757 is just: Backup.ExportToFile(archivo);
The options I use is:
Backup.ExportInfo.EnableEncryption = true; Backup.ExportInfo.EncryptionPassword = "N7vngar45mDy5Cqxa"; Backup.ExportInfo.MaxSqlLength = 3145728; Backup.ExportInfo.AddCreateDatabase = false; Backup.ExportInfo.ExportProcedures = true; Backup.ExportInfo.ExportFunctions = true; Backup.ExportInfo.ExportTriggers = true; Backup.ExportInfo.WrapWithinTransaction = true; Backup.ExportInfo.ExportTableStructure = true; Backup.ExportInfo.ExportRows = true; Backup.ExportInfo.GetTotalRowsBeforeExport = true; Backup.ExportInfo.IntervalForProgressReport = 100; Backup.ExportInfo.RowsExportMode = RowsDataExportMode.Insert;

I am actually thinking of dropping the encryption function. The encryption is performed line by line which will slow the whole process a lot.
Anyway, at the mean time, the better solution which I recommended is: perform the encryption externally after the Export process completed.
There are many encryption algorithms out there. Here is one of the example of implementing AES 256 bit encryption. Source code can be found at: https://www.codeproject.com/Articles/769741/Csharp-AES-bits-Encryption-Library-with-Salt
And if you are going to encrypt your file, you definitely also want to compress the file which will make the file 50%-70% smaller in size.
Example:
Export
string backupFile = "C:\\backup";
string connstr = "server=localhost;user=root;pwd=1234;database=test;";
string password = "1234";

MemoryStream ms = new MemoryStream();

using (MySqlConnection conn = new MySqlConnection(connstr))
{
    using (MySqlCommand cmd = new MySqlCommand())
    {
        using (MySqlBackup mb = new MySqlBackup(cmd))
        {
            conn.Open();
            cmd.Connection = conn;

            mb.ExportToMemoryStream(ms);

            conn.Close();
        }
    }
}

byte[] ba = ms.ToArray();

// 1st Compress the file data
ba = CompressData(ba);

// 2nd Encrypt the file data
ba = AES_Encrypt(ba, password);

// 3rd Write the file data to disk
File.WriteAllBytes(backupFile, ba);

Import
string backupFile = "C:\\backup";
string connstr = "server=localhost;user=root;pwd=1234;database=test;";
string password = "1234";

// 1st Read the file bytes
byte[] ba = File.ReadAllBytes(backupFile);

// 2nd Decrypt the file data
ba = AES_Decrypt(ba, password);

// 3rd Decompress the file data
ba = DecompressData(ba);

MemoryStream ms = new MemoryStream(ba);

using (MySqlConnection conn = new MySqlConnection(connstr))
{
    using (MySqlCommand cmd = new MySqlCommand())
    {
        using (MySqlBackup mb = new MySqlBackup(cmd))
        {
            conn.Open();
            cmd.Connection = conn;

            mb.ImportFromMemoryStream(ms);

            conn.Close();
        }
    }
}

Compression
using System.IO.Compression;

public byte[] CompressData(byte[] data)
{
    MemoryStream output = new MemoryStream();
    using (DeflateStream dstream = new DeflateStream(output, CompressionLevel.Optimal))
    {
        dstream.Write(data, 0, data.Length);
    }
    return output.ToArray();
}

public byte[] DecompressData(byte[] data)
{
    MemoryStream input = new MemoryStream(data);
    MemoryStream output = new MemoryStream();
    using (DeflateStream dstream = new DeflateStream(input, CompressionMode.Decompress))
    {
        dstream.CopyTo(output);
    }
    return output.ToArray();
}

Encryption
using System.Security.Cryptography;

public static string AES_Encrypt(string input, string password)
{
    byte[] clearBytes = System.Text.Encoding.UTF8.GetBytes(input);
    byte[] encryptedData = AES_Encrypt(clearBytes, password);
    return Convert.ToBase64String(encryptedData);
}

public static byte[] AES_Encrypt(byte[] input, string password)
{
    return AES_Encrypt(input, Encoding.UTF8.GetBytes(password));
}

public static byte[] AES_Encrypt(byte[] input, byte[] password)
{
    PasswordDeriveBytes pdb = new PasswordDeriveBytes(password, new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 });
    return AES_Encrypt(input, pdb.GetBytes(32), pdb.GetBytes(16));
}

public static string AES_Decrypt(string input, string password)
{
    byte[] cipherBytes = Convert.FromBase64String(input);
    byte[] decryptedData = AES_Decrypt(cipherBytes, password);
    return System.Text.Encoding.UTF8.GetString(decryptedData);
}

public static byte[] AES_Decrypt(byte[] input, string password)
{
    return AES_Decrypt(input, Encoding.UTF8.GetBytes(password));
}

public static byte[] AES_Decrypt(byte[] input, byte[] password)
{
    PasswordDeriveBytes pdb = new PasswordDeriveBytes(password, new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 });
    return AES_Decrypt(input, pdb.GetBytes(32), pdb.GetBytes(16));
}

static byte[] AES_Encrypt(byte[] clearData, byte[] Key, byte[] IV)
{
    byte[] encryptedData = null;
    using (MemoryStream ms = new MemoryStream())
    {
        using (Rijndael alg = Rijndael.Create())
        {
            alg.Key = Key;
            alg.IV = IV;
            using (CryptoStream cs = new CryptoStream(ms, alg.CreateEncryptor(), CryptoStreamMode.Write))
            {
                cs.Write(clearData, 0, clearData.Length);
                cs.Close();
            }
            encryptedData = ms.ToArray();
        }
    }
    return encryptedData;
}

static byte[] AES_Decrypt(byte[] cipherData, byte[] Key, byte[] IV)
{
    byte[] decryptedData = null;
    using (MemoryStream ms = new MemoryStream())
    {
        using (Rijndael alg = Rijndael.Create())
        {
            alg.Key = Key;
            alg.IV = IV;
            using (CryptoStream cs = new CryptoStream(ms, alg.CreateDecryptor(), CryptoStreamMode.Write))
            {
                cs.Write(cipherData, 0, cipherData.Length);
                cs.Close();
            }
            decryptedData = ms.ToArray();
        }
    }
    return decryptedData;
}

Thank you very much for your response, that definitely should work.
And again, you're doing a great work with this.

After I have started this project, I have received feedback, bug reports & fixes, code improvement suggestions, patches from kind programmers around the world which makes the library becomes better as time goes. Credits goes to them too :)
Anyway, thanks and you're welcome ;)

I assume you did drop the function as I can't find it in the docs, but the example here is very useful in getting me that sorted - thanks.


The Spline Runtime only accepts .splinecode files that are generated from Spline export panel.

Yeah, you can't use .spline files with react-spline. Please use the .splinecode available at this link


[hi] Localize en/docs/concepts/cluster-administration into Hindi

Localize en/docs/concepts/cluster-administration into Hindi

Page address: https://kubernetes.io/docs/concepts/cluster-administration/

File path: en/docs/concepts/cluster-administration

/assign


Added ChatWork action

Like the slack integration you can send a notification to a ChatWork e.g.:
  ENV["CHATWORK_API_TOKEN"] = "Your API token"

  chatwork(
    message: "App successfully released!",
    roomid: 12345,
    success: true
  )

Coverage decreased (-0.39%) to 82.52% when pulling 633d7e99c09147965ba81dec90e796733f148672 on chatwork:master into 0161ee0373a49bd053b37dba27c81ee88c6d057e on KrauseFx:master.

Looks great, thanks @cw-ueno, this will be in the next release :+1:

@KrauseFx Thank you for your quick action ! :smile:


Updated checkout

New reliable click buy button code
Pass in cvv, shipping address, shipping option
shoe-size no long required (due to special shoe type, such as Air Presto)
shoe-type handles special shoe type.
Exception thrown if "W", "Y", "C" passed in without shoe size.
Poll for which checkout section appears first
Poll after shipping option selection for which checkout section appears next (for user who hasn't previously purchased a SNKRs release vs a user who has)
Added wait_until_present
xpath used for save button (payment section) and submit button (purchase) due to potential iFrame issue if cvv has been input.
Added StaleElementReferenceException for 2nd save button click (shipping option) to attempt retry save button click once

Updated code thoroughly tested and was able to reach “Purchased shoe” in both headless and browser mode

@alfredog1976 Damn, nice work. Gonna take me some time to review it. In the meantime, you've got a merge conflict to fix.

I tried this on an existing launch product and it can't seem to find the buy button. On the page itself it says it's add to cart  and not buy, is this because it's not a drop?

Tried this out today. Got stuck on cvv input. Was able to save the html page though.

Tried this out today. Got stuck on cvv input. Was able to save the html page though.

Can you upload the HTML page

Once I find out how to sanitize some info from it.

Figured it out. Missing "cvv=args.cvv" on the run function.

What's up boys, was trying to join in on the work but couldn't get past login page. We got a discord to discuss setup?

Wanting to help on this project if yall are still working on it?


Connection refused does not return an error

I noticed that when SRH is unable to connect to redis, it does not return an error, making the @upstash/redis client return nothing, but not throw an error.
In the SRH logs, I see this:
17:16:16.075 [error] #PID<0.3067.0> running Srh.Http.BaseRouter (connection #PID<0.2318.0>, stream id 298) terminated
Server: redis.example.com:80 (http)
Request: POST /
** (exit) an exception was raised:
    ** (KeyError) key :message not found in: %Redix.ConnectionError{reason: :closed}
        (srh 0.1.0) lib/srh/http/command_handler.ex:160: Srh.Http.CommandHandler.dispatch_command/2
        (srh 0.1.0) lib/srh/http/base_router.ex:35: Srh.Http.BaseRouter.do_command_request/2
        (srh 0.1.0) lib/plug/router.ex:246: anonymous fn/4 in Srh.Http.BaseRouter.dispatch/2
        (telemetry 1.1.0) /app/deps/telemetry/src/telemetry.erl:320: :telemetry.span/3
        (srh 0.1.0) lib/plug/router.ex:242: Srh.Http.BaseRouter.dispatch/2
        (srh 0.1.0) lib/srh/http/base_router.ex:1: Srh.Http.BaseRouter.plug_builder_call/2
        (plug_cowboy 2.5.2) lib/plug/cowboy/handler.ex:12: Plug.Cowboy.Handler.init/2
        (cowboy 2.9.0) /app/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2

This can be repro'd by specifying the wrong redis port

Thanks for reporting this, I can work on getting a fix together.
How do you think is approriate to respond? Since this is a situation that upstash sdk isn't expecting, do you think just throwing back a 500 w/ a desc as body? What status is it responding with right now?

Not sure what status it's returning currently - the client just doesn't return data.
I think returning 500 with a description would work - just something to get the client to throw an error

Running into one issue that Upstash's SDK doesn't have error 500 handling (as it doesn't expect it), so when I return 500 with a message, it's actually hitting a JSON parse error.
Invalid token is short enough that that the error message doesn't get truncated, but with "Unable to connect to Redis",
it becomes
SyntaxError: Unexpected token 'U', "Unable to "... is not valid JSON
This does throw an error however, and if I also add a simple log message to SRH (I think it's valid to have it in SRH logs because it is a misconfiguration of SRH in most cases) those two pieces of the puzzle should be enough to figure out whats going wrong

SRH now logs
WARNING: SRH was unable to connect to the Redis server. Please make sure it is running, and the connection information is correct. SRH ID: some_unique_identifier

This sounds good! That’s odd that the sdk doesn’t actually care about status codes. I wonder how Upstash communicates errors

I'm not sure either. I'm going to dig into the code later and find out - if I can't find anything that I can use there, I'm just going to push out this new code as-is.
I don't want it to report back as a Redis error (e.g command, missing error, etc), because that can be handled in code as a valid response (so I don't think it makes any DX improvement over what is now), instead doing it this way and using a 5xx status code
I want it to be as close as if Upstash was down than there being a syntax / command logic error

Upstash doesn't directly look at response codes, instead just uses fetch's res.ok
https://github.com/upstash/upstash-redis/blob/9b75ea104a3ebdcee8ce0360302782200938999c/pkg/http.ts#L214-L217
It also does res.json() before doing the check, so the error being thrown in regards to JSON parsing is caused directly here.
If non 2xx, it throws an UpstashError with the error field from the parsed json.
The question then is: is it reasonable for an UpstashError to be thrown, when this exact field is used for normal Redis errors? Or is "hacking around" and causing the JSON error more reasonable (so it's clear its not a Redis command error)

I think triggering UpstashError is probably fine - I'd just prefix the error with SRH or something so it's clear that it's not an actual Redis error. I presume that Upstash probably does something similar if you try to connect to a server that doesn't exist/etc.

Yeah you're right, it'll just be fine as an Upstash error - I've prefixed with SRH and now being thrown is
UpstashError: SRH: Unable to connect to the Redis server. See SRH logs for more information.
Going to get this all cleaned up and will put out a release


Root category url causes redirect loop

What is the purpose of this rewrite? I have to delete the row, otherwise a request to the home page of my store causes an infinite redirect loop.

The same bug was reported here: https://github.com/experius/Magento2-Module-Experius-ReindexCatalogUrlRewrites/issues/10

Please report the bug in the magento/magento2 repo. The reason why this happens in this extension and in the one you mention is because it's not in the extension. These extensions only trigger generation of the rewrite URL's, it doesn't make the actual rewrites, Magento does.

@ctadlock sorry to have jumped the gun by blaming Magento back in November. I just ran into this myself and it turns out you're right. I now added a level filter to skip the root categories when letting Magento generate the URLs; https://github.com/elgentos/regenerate-catalog-urls/commit/6a31dc88c8eba00bca1bdea7f0310283d02d792c
Again, sorry to have dismissed your comment so easily.

@peterjaap This doesnt seem to have resolved the issue. My category id:2 is Default Category; its parent id:1 is Root Category.
Is this a multi-store issue? I have two websites; one for USA and one for Canada.
I have to run this sql to remove the record that causes the home page redirect.
DELETE FROM `url_rewrite` WHERE `entity_type` = 'category' AND `request_path` = '/';

url_rewite...

catalog_category_entity...

admin...

@gototagsdev ID's shouldn't matter, I'm filtering on level greater than 1. Judging from your screenshots, this should exclude the Default Category (with ID 2 and level 1). Are you sure you're using the latest version?


WIP Adding coverall.io

Is this adding or improving a feature or fixing a bug?
feature
What's the new behavior?
Sometimes we make careless mistakes just by forgetting to test, or decide to add tests later but forgot.  (for example, PR https://github.com/ianstormtaylor/slate/pull/1864 is an example that a test is missing)
Code analysis can help us eliminate these problems, and suggests us which tests are perhaps missing.  And new PR contributors can look at the code coverage difference by code
How does this change work?
Add coverall.io
Have you checked that...?

[ ] The new code matches the existing patterns and styles.
[ ] The tests pass with yarn test.
[ ] The linter passes with yarn lint. (Fix errors with yarn prettier.)
[ ] The relevant examples still work. (Run examples with yarn watch.)

Does this fix any issues or need any specific reviewers?
Fixes: #
Reviewers: @

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@73daa94). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master       #4   +/-   ##
=========================================
  Coverage          ?   57.72%
=========================================
  Files             ?       70
  Lines             ?     4963
  Branches          ?     1259
=========================================
  Hits              ?     2865
  Misses            ?     1550
  Partials          ?      548

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 73daa94...cb7b67f. Read the comment docs.

Close this PR because it absorbs travis test from ian's main repo


No Transformations despite installed jsregexp

Transformations don't seem to be applying for me. I have tried a variety of installation methods for jsregexp, and verified installation with the following lua code:
local jsregexp_ok, jsregexp = pcall(require, "luasnip-jsregexp")
print(jsregexp_ok)
if not jsregexp_ok then
	jsregexp_ok, jsregexp = pcall(require, "jsregexp")
end
print(jsregexp_ok)

Running with :luafile % outputs:
false
true

...for my current installation method via luarocks, as recommended here.
With the following example snippet, it's expected that every character captured by $1 will be replaced by _:
snippet mysnip
  hello ${1/.*/_/g};$2

Instead, no transformation is applied. I'm following the syntax described here, and I understand not all of it is fully supported.
Version info:
$ nvim --version
NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3

$ pacman -Qi luajit
Name            : luajit
Version         : 2.1.0.beta3.r449.gdad04f17-1
Description     : Just-in-time compiler and drop-in replacement for Lua 5.1

Also note that I did not previously have Lua 5.1. I performed the following installs:
sudo pacman -S lua51
sudo luarocks --lua-version 5.1 install jsregexp

According to the output, jsregexp should be available to luasnip..
AFAICT the snippet you showed is missing the source for the transformed string, could you try hello $1 ${1/./_/g}; $2?

Thanks for the quick response. Indeed, the snippet you supplied works.
I had been testing more complex snippets and was having trouble with the syntax, porting them from UltiSnips.
Before (not working)
snippet r.us "React.useState"
  const [${1}, set${1/\w+/\u${0}/}] = React.useState(${3:''});${0}

After (working!)
snippet r.us "React.useState"
  const [$1, set${1/(.*)/${1:/capitalize}/}] = React.useState(${3:''});${0}

It seemed using parenthesis for a capture group was also necessary for the :/capitalize transform to work. Thank you again

Ahh, yeah it's possible ultisnips is doing something different there, probably closer to vim-regex.
 :)


Support the ".env" file in move2kube

move2kube translate does not support the .env file while parsing the docker-compose.yaml file. It returns an error-
Error while loading docker compose config : 1 error(s) decoding:

* error decoding 'Ports': No port specified: :<empty>
ERRO[0009] Unable to parse docker compose file dock-com/docker-compose.yaml using *compose.V3Loader : 1 error(s) decoding:

* error decoding 'Ports': No port specified: :<empty>

The below files can be used to reproduce the error.
# this is the docker-compose.yaml file
version: '3.4'
services:
    goodbot:
        image: python
        env_file:
            - .env
        ports:
            - ${PORT}:${PORT}

# this is .env file
PORT=123

(kompose convert also has similar issue- https://github.com/kubernetes/kompose/issues/1289)

Any update on this issue?
I am facing the same issue.
`FATA Unable to load files: 1 error(s) decoding:

error decoding 'Ports': Invalid containerPort: ${PORT}`

@kkashyap1707 The original issue is from a much older version of Move2Kube v0.1.0 and v0.2.0 which had the move2kube translate command. It has been replaced by the transform command https://move2kube.konveyor.io/tutorials/cli
Feel free to create a new issue if this is still relevant in the latest v0.3.x versions of Move2Kube.


add possible issues to quickstart doc

Described a possible installation issue and solution regarding a wrong GLIBCXX version (#50)

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


Adding export_options to gym not working

New Issue Checklist

[x] Updated fastlane to the latest version
[x] I read the Contribution Guidelines
[x] I read docs.fastlane.tools
[x] I searched for existing GitHub issues

Existing issue #10685
Issue Description
Because of issue #10685 I manually changed 'signingStyle' to 'automatic' in the plist and exporting is working correctly then.
So to achieve this via fastlane I added this in my gym command:
export_options: {
                signingStyle: "automatic"
        }

But when I run fastlane the signingStyle of generated plist is still 'manual'. I don't want this... Did I do anything wrong or is this een issue in fastlane?!
Sorry I don't past all content of fast file etc because it contains confidential information. Please ask me if you need some specific parts to answer my question.
Environment

Key
Value

OS
10.12.6

Ruby
2.2.4

Bundler?
false

Git
git version 2.8.1

Installation Source
~/.fastlane/bin/bundle/bin/fastlane

Host
Mac OS X 10.12.6 (16G29)

Ruby Lib Dir
~/.fastlane/bin/bundle/lib

OpenSSL Version
OpenSSL 1.0.2g  1 Mar 2016

Is contained
false

Is homebrew
true

Is installed via Fabric.app
false

Xcode Path
/Applications/Xcode.app/Contents/Developer/

Xcode Version
9.0.1

System Locale

Variable
Value

LANG
en_US.UTF-8
✅

LC_ALL
en_US.UTF-8
✅

LANGUAGE
en_US.UTF-8
✅

Hey @MartijnSchoemaker - could you share the xcodebuild command that is generated by fastlane and output to your terminal?

Some parts that are useful I think:
+--------------------------------------+--------------------------------------+
| Summary for gym 2.63.0 |
+--------------------------------------+--------------------------------------+
| workspace | wehkamp.xcworkspace |
| configuration | DebugDistribution |
| scheme | wehkamp |
| silent | true |
| output_name | wehkamp |
| export_team_id | 8V375A94TK |
| export_xcargs | -allowProvisioningUpdates |
| export_options.signingStyle | automatic |
| export_method | ad-hoc |
| destination | generic/platform=iOS |
| build_path | /Users/monitor/Library/Developer/Xc |
| | ode/Archives/2017-11-02 |
| clean | false |
| skip_package_ipa | false |
| buildlog_path | ~/Library/Logs/gym |
| skip_profile_detection | false |
| xcode_path | /Applications/Xcode.app |
+--------------------------------------+--------------------------------------+
[15:21:04]: Generated plist file with the following values:
[15:21:04]: ▸ -----------------------------------------
[15:21:04]: ▸ {
[15:21:04]: ▸ "signingStyle": "manual",
[15:21:04]: ▸ "provisioningProfiles": {
[15:21:04]: ▸ "nl.wehkamp.PDD5388SwipeBetweenPDP": "nl.wehkamp.PDD5388SwipeBetweenPDP AdHoc"
[15:21:04]: ▸ },
[15:21:04]: ▸ "method": "ad-hoc",
[15:21:04]: ▸ "teamID": "8V375A94TK"
[15:21:04]: ▸ }
[15:21:04]: ▸ -----------------------------------------
xcodebuild -exportArchive -exportOptionsPlist /var/folders/w3/pts492bj42359t0w2_kxd91m0000gp/T/gym_config20171102-82214-mogew.plist -archivePath '/Users/monitor/Library/Developer/Xcode/Archives/2017-11-02/wehkamp 2017-11-02 15.04.10.xcarchive' -exportPath /var/folders/w3/pts492bj42359t0w2_kxd91m0000gp/T/gym_output20171102-82214-1dcrlqx -allowProvisioningUpdates

If I manually change gym_config20171102-82214-mogew.plist (signingStyle : 'automatic') and run the xcodebuild command manually, everything works fine...

We're running into the same issue. After updating to Xcode 9 builds are failing. Hand editing the plist to set signingStyle to automatic fixes the issue but gym ignores export_options: { signingStyle: "automatic" } and sets the signingStyle to manual.

@MartijnSchoemaker Hi! but as I can see, your provisioning profiles is not empty, so it switches to manual signingStyle and I think it cannot find specified provisioning profile. how you specify this provisioning profiles? try to find it in your Fastfile.

I have this line in my lane:
   sigh(adhoc: true, force: true, app_identifier: params[:app_identifier])
I can try removing this, but apart from that it's still strange:

That 'signingStyle: "manual" is now explicitly added to plist.
If you specify I specify in gym that I want to use automatic it simply ignores this.

it ignored because have provisioning profiles in export_options, automatic signingStyle will use xcode-managed provisioning profiles. In case where you setup provisioning profile always should used signingStyle as manual.
If you want to use automatic signingStyle, so remove provisioning profiles from export_options.
In your case I don't understand how provisioning profiles appeared in export_options and if it do by Sigh, so it have issue. But you cannot share Fastfile, and maybe you will try to find where provisioning profiles was specified?
maybe has the meaning to don't ignore signingStyle in export_options if it specified by user. it will add flexibility.

It seems te be fixed.
First I removed 'sigh', but then I got an error that app id already exists. This maybe could caused by using 'produce' in my lane. So I also removed this, now it seems to work...:
lane :adhoc do |params|
    update_info_plist(plist_path: "wehkamp/Info.plist", display_name: params[:app_name], app_identifier: params[:app_identifier])
    update_info_plist(plist_path: "notificationService/Info.plist", app_identifier: params[:app_identifier] + ".notificationService" )
#             app_name: params[:app_name],
#            skip_itc: true,
#            enable_services: { associated_domains: "on"} )
#    produce(app_identifier: params[:app_identifier] + ".notificationService",
#            app_name: params[:app_name] + "notserv",
#            skip_itc: true,
#            enable_services: { associated_domains: "on"} )
...
#sigh(adhoc: true, force: true, app_identifier: params[:app_identifier] )

   enable_automatic_code_signing(path: "wehkamp.xcodeproj")
    gym(
        workspace: "wehkamp.xcworkspace",
        configuration: "DebugDistribution",
        scheme: "wehkamp",
        silent: true,
        output_directory: params[:output_directory],
        output_name: "wehkamp.ipa",
        export_team_id: "",
        export_xcargs: "-allowProvisioningUpdates"
    )
end

I doesn't work the second time running this... :(
Because it added the app id and prov profiles the first time running the script. I get now this error message:
 "An App ID with Identifier 'nl.wehkamp.Adventskalender' is not available. Please enter a different string."

maybe problem in export_team_id: "",? why you should use this?

@threat70 sorry I did it for obfuscation but that doesn't make any sense because you can find the teamId also on other places. I added it again, so its now as it really is.

@MartijnSchoemaker You build it on CI or local machine? have you tried to build through Xcode?

It's on CI machine, but calling fastlane locally doesn't work neither. Build in Xcode just works. The fastlane build always worked before update 3.62.0 (see #10685)...
Problem has to do with changing the app name and identifier and creating prov files for this with fastlane.

OMG by changing the fast file as is now as mentioned in previous comment I get now this generated plist:
[09:01:29]: Generated plist file with the following values:
[09:01:29]: ▸ -----------------------------------------
[09:01:29]: ▸ {
[09:01:29]: ▸   "method": "app-store",
[09:01:29]: ▸   "teamID": "8V375A94TK"
[09:01:29]: ▸ }
[09:01:29]: ▸ -----------------------------------------

That does even make any less sense... 'app-store' why?!

I noticed that you have no provisioning profile for NotificationService module, check it on developer.apple.com portal.

No, I tried adding this manually, but also not succeeded.
But I don't want to do manually. I just want that everything is handled automatic, like it did before update 2.62.1. What should I do to achieve this? I

I'm now trying to do everything manually. The profile for notification service is created now, but get this error:
 Provisioning profile "nl.wehkamp.*.notificationService AdHoc" doesn't match the entitlements file's value for the application-identifier entitlement.
I have not this in fast file:
produce(app_identifier: params[:app_identifier] + ".notificationService",
            app_name: params[:app_name] + "notserv",
            skip_itc: true,
            enable_services: {
                push_notification: "off"
            }
    )

All capabilities for this target are set to 'off':

I have been having this issue since 2.62.1 was released.  I have pinned to version 2.62.0 for now to be able to build for App Store.  I have tried to force automatic, but no matter where I do this (Gymfile, or as params to gym in the fast file) - it always goes to manual.
[11:12:42]: ▸ Archive Succeeded
[11:12:42]: Generated plist file with the following values:
[11:12:42]: ▸ -----------------------------------------
[11:12:42]: ▸ {
[11:12:42]: ▸   "signingStyle": "manual",
[11:12:42]: ▸   "method": "app-store",
[11:12:42]: ▸   "uploadSymbols": true,
[11:12:42]: ▸   "uploadBitcode": true
[11:12:42]: ▸ }
[11:12:42]: ▸ -----------------------------------------
This the archive will fail - because of trying to manual sign and my extensions start complaining about prov profiles.

Pinning to 2.62.0 in the Gemfile resolves the issue, however, I've also found that doing anything with sigh in the fastfile causes the signingStyle to resort to manual. We had calls to sigh repair and sigh in one of our fastfiles and that was causing the signingStyle to switch to "manual". Removing all calls to sigh seemed to fix the issues.

Interesting!  I just commented sigh out of my lane for submitting a build to apple, upgraded to latest Fastlane to give it a go, and can confirm that it works!
Generated plist file with the following values:
[14:21:12]: ▸ -----------------------------------------
[14:21:12]: ▸ {
[14:21:12]: ▸   "method": "app-store",
[14:21:12]: ▸   "uploadSymbols": true,
[14:21:12]: ▸   "uploadBitcode": true
[14:21:12]: ▸ }

Heyyyyyyy 👋 Adding this to my list to look into if this is still an issue 😊

@joshdholtz  FYI still experiencing this against 'fastlane', '2.85.0'.

development archiving and submission to Crashlytics working correctly with gym:

Gym call:
gym(
    scheme: scheme,
    archive_path: "./#{scheme}",
    output_name: scheme,
    configuration: "Debug",
    export_method: "development",
    export_options: {
      provisioningProfiles: {
          "com.xvia.TrackVia-Develop": "match Development *",
          "com.xvia.TrackVia-Develop.watchkitapp": "match Development com.xvia.TrackVia-Develop.watchkitapp",
          "com.xvia.TrackVia-Develop.watchkitapp.watchkitextension": "match Development com.xvia.TrackVia-Develop.watchkitapp.watchkitextension"
    }
  }
)

Console log:
[11:44:20]: Generated plist file with the following values:
[11:44:20]: ▸ -----------------------------------------
[11:44:20]: ▸ {
[11:44:20]: ▸   "provisioningProfiles": {
[11:44:20]: ▸     "com.xvia.TrackVia-Develop": "match Development *",
[11:44:20]: ▸     "com.xvia.TrackVia-Develop.watchkitapp": "match Development com.xvia.TrackVia-Develop.watchkitapp",
[11:44:20]: ▸     "com.xvia.TrackVia-Develop.watchkitapp.watchkitextension": "match Development com.xvia.TrackVia-Develop.watchkitapp.watchkitextension",
[11:44:20]: ▸     "*": "match Development *"
[11:44:20]: ▸   },
[11:44:20]: ▸   "method": "development",
[11:44:20]: ▸   "signingStyle": "manual"
[11:44:20]: ▸ }
[11:44:20]: ▸ -----------------------------------------

ad-hoc archiving fails due to provisioning with gym:

gym(
    scheme: scheme,
    archive_path: "./#{scheme}",
    output_name: scheme,
    configuration: "Adhoc",
    export_method: "ad-hoc",
    export_options: {
      method: "ad-hoc",
      signingStyle: "automatic",
      provisioningProfiles:   {
        "com.xvia.TrackVia-Beta": "match AdHoc *",
        "com.xvia.TrackVia-Beta.watchkitapp": "match AdHoc com.xvia.TrackVia-Beta.watchkitapp",
        "com.xvia.TrackVia-Beta.watchkitapp.watchkitextension": "match AdHoc com.xvia.TrackVia-Beta.watchkitapp.watchkitextension"
      }
  }
)

Console log:
[12:41:59]: Generated plist file with the following values:
[12:41:59]: ▸ -----------------------------------------
[12:41:59]: ▸ {
[12:41:59]: ▸   "method": "ad-hoc",
[12:41:59]: ▸   "signingStyle": "manual",
[12:41:59]: ▸   "provisioningProfiles": {
[12:41:59]: ▸     "com.xvia.TrackVia-Beta": "match AdHoc *",
[12:41:59]: ▸     "com.xvia.TrackVia-Beta.watchkitapp": "match AdHoc com.xvia.TrackVia-Beta.watchkitapp",
[12:41:59]: ▸     "com.xvia.TrackVia-Beta.watchkitapp.watchkitextension": "match AdHoc com.xvia.TrackVia-Beta.watchkitapp.watchkitextension",
[12:41:59]: ▸     "*": "match AdHoc *",
[12:41:59]: ▸     "com.xvia.TrackVia-Develop.watchkitapp": "match AdHoc com.xvia.TrackVia-Develop.watchkitapp",
[12:41:59]: ▸     "com.xvia.TrackVia-Develop.watchkitapp.watchkitextension": "match AdHoc com.xvia.TrackVia-Develop.watchkitapp.watchkitextension"
[12:41:59]: ▸   }
[12:41:59]: ▸ }
[12:41:59]: ▸ -----------------------------------------

Also not sure why my develop profiles get returned in the adhoc case since I'm not explicitly specifying them?
Happy to provide more insight, frustrated we haven't had much luck doing AdHoc or AppStore archives with Fastlane for quite a few months!

Upgrading to Fastlane 2.88.0 resulted in some more promising logs, but still resulted in the same error state :(

@trackvia-ios Can you try removing method: "ad-hoc", from your export_options?

Same issue since 2.62.0 + versions =(

@joshdholtz @KrauseFx  I've removed export_method from all places and still seeing the exact same results. Seems to be adding ad-hoc automatically:
[15:44:54]: Generated plist file with the following values:
[15:44:54]: ▸ -----------------------------------------
[15:44:54]: ▸ {
[15:44:54]: ▸   "signingStyle": "manual",
[15:44:54]: ▸   "provisioningProfiles": {
[15:44:54]: ▸     "com.XXX.App-Beta": "match AdHoc *",
[15:44:54]: ▸     "com.XXX.App-Beta.watchkitapp": "match AdHoc com.XXX.App-Beta.watchkitapp",
[15:44:54]: ▸     "com.XXX.App-Beta.watchkitapp.watchkitextension": "match AdHoc com.XXX.App-Beta.watchkitapp.watchkitextension",
[15:44:54]: ▸     "*": "match AdHoc *",
[15:44:54]: ▸     "com.XXX.App-Develop.watchkitapp": "match AdHoc com.XXX.App-Develop.watchkitapp",
[15:44:54]: ▸     "com.XXX.App-Develop.watchkitapp.watchkitextension": "match AdHoc com.XXX.App-Develop.watchkitapp.watchkitextension"
[15:44:54]: ▸   },
[15:44:54]: ▸   "method": "ad-hoc"
[15:44:54]: ▸ }

It seems undesired for it to be adding my Develop provisioning profiles in with my Beta profiles, perhaps that's what's causing error? I'm ONLY specifying beta options in my export_options mapping.
Also to note, I'm NOT using an export options plist, but the export_options hash option.
Let me know if I can provide anymore insight @Matsepura @joshdholtz

It seems even if I completely remove everything from my Gymfile, and strip Gym to the following:
gym(
    scheme: scheme,
    archive_path: "./#{scheme}",
    output_name: scheme,
    configuration: configuration)

I see more red error output regarding:
[09:53:11]: There seems to be a mismatch between your provided `export_method` in gym
[09:53:11]: and the selected provisioning profiles. You passed the following options:

But it's still using the same generated plist file...
I'm going to try creating a static plist file and load that to see if it doesn't auto-set the "method"

Doing some digging, it appears the package_command_generator_xcode7 is always setting the export_method:

I set method to an empty string in my exportOptions, but it seems no matter what I do, it still gets method ad-hoc, everytime.
Any other suggestions as to what to try?

@trackvia-ios Are you running either match or sigh before you call gym?

Thanks for getting back, @joshdholtz  and yes, just for reference we have had all of our deployments working in the past for Development, Ad Hoc, and App Store using Fastlane previously.
match(git_branch: "master",
team_id: "REDACTED",
team_name: "REDACTED",
type: "adhoc",
app_identifier: "com.xvia.TrackVia-Beta.watchkitapp",
readonly: readonly,
force_for_new_devices: true,
keychain_name: keychain_name,
keychain_password: keychain_password)

Is type adhoc here causing problem?

I think this line:
Actions.lane_context[SharedValues::SIGH_PROFILE_TYPE] = profile_type
inside sync_code_signing.rb is the one that's automatically assigning type "ad-hoc" based on the match provisioning?

@trackvia-ios Can I ask why you are trying to do export_method: "development" with adhoc profiles? 🙃

@joshdholtz sorry for the delay. I'm not intending to do export_method: "development" with adhoc profiles. I was just demonstrating to you that I am able to archive no problem my Debug, development target via gym, but every time I switch to ad-hoc and/or Release, the automatic provisioning profiles that are selected are incorrect, and I cannot pass my own export_options plist because it seems to always be overridden regardless of what I provide (explicit map in Ruby or plist).
Any suggestions would be great. I've tried to follow the latest Xcode 9 codesigning guidelines on Fastlane docs but still must be missing one final piece.
Thanks!


DiskSpacePlus is not compatible with flutter 3.22.1

after run flutter, console show this error:
FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':disk_space_plus:compileDebugKotlin'.

Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (1.8) and 'compileDebugKotlin' (17).

Consider using JVM Toolchain: https://kotl.in/gradle/jvm/toolchain
Learn more about JVM-target validation: https://kotl.in/gradle/jvm/target-validation

Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

Get more help at https://help.gradle.org

BUILD FAILED in 1m 16s
Error: Gradle task assembleDebug failed with exit code 1
any help ?

Hello @maxdiable,
Since this package hasn't been updated in 2 years and the maintainers haven't responded to any issues or pull requests, I created a new repository: https://github.com/activcoding/disk_space_2. The updated package, which should work, is available here: https://pub.dev/packages/disk_space_2.


"onBackdropPress" runs when keyboard is open

Info
react-native => "^0.57.8"
react-native-modal => "^7.0.2"
testing on "Samsung S9+"
Problem
I am testing on android, while everything functions properly when there is no keyboard, but when keyboard is open, the onBackdropPress executes when clicked inside the modal as shown below in the image:

This is the style of the modal container:
container: {
        position: 'relative',
        padding: moderateScale(20),
        alignItems: 'flex-start',
        backgroundColor: '#fff',
        borderWidth: 1,
        borderColor: COLOR_BORDER_LIGHT,
        borderRadius: 30,
}

@mmazzarolo , sorry for the late reply, yes the white padding, if I tap on the lower part of the submit button, the modal gets dismissed, not sure if anyone else had this problem!

Seems to be more of an android layout issue. Mind creating a simple repo for reproducing it? Thank you!

Can confirm this behavior. When onBackdropPress is set to closing the modal, when the keyboard opens up, you can touch anywhere outside of the keyboard to close the modal. It's not a good behavior.

@danielnmai thanks for reporting.
I guess it could be solved by disabling onBackdropPress when the keyboard is open.
It can be done directly in your app (just put the onBackdropPress in the state and change it based on the keyboard state), but the most elegant solution is probably putting it directly in react-native-modal. Anyone willing to tackle it with a PR?

@mmazzarolo @danielnmai This issue still happening? I would like to help with this but I have no success reproducing the problem.

yes, it's still happening. Let's me pull down an example code ASAP.

Finally have to some time to set up a repo to demonstrate this issue.
First, clone and install this example app here: https://github.com/danielnmai/RNModalDemo
Steps to reproduce the issue:

Press the "Show Modal" link on top left corner
Press the text input field to bring up the keyboard
While the keyboard is open, press anywhere in the screen to close the modal, INCLUDING pressing on the modal itself

Observed behavior: pressing anywhere on the screen, including on the modal, will close the modal
Expected behavior: pressing anywhere outside the screen, NOT including the modal, would close it.
Video: https://d.pr/free/v/WTbtC2

is anyone still having this problem? here's a snack based on @danielnmai code example, I tested it here and couldn't replicate the problem.


Enter one-line summary

From<EMAIL_ADDRESS>on January 10, 2007 09:52:24
What steps will reproduce the problem? 1. 2. 3. What is the expected output? What do you see instead? What version of the product are you using? On what operating system? Please provide any additional information below.
Original issue: http://code.google.com/p/gperftools/issues/detail?id=5

From<EMAIL_ADDRESS>on February 09, 2007 14:59:44
Status: Invalid


Why I can't use functional approach? [javascript/exercises/concept/bird-watcher]

I don't want to use ancient "for", thanks, I want my guard clauses and map
export function fixBirdCountLog(birdsPerDay) {
  return birdsPerDay.map(function (day, index) {
    const isOdd = index % 2 === 0;
    if (isOdd) {
      return day + 1;
    }
    return day;
  });
}

I am sorry but I have to reject this change.
Here the reasoning:

A lot of students like this exercise as is and people request mentoring for it regularly (meaning it is not too trivial for everyone to just go over it).
To be a well rounded JS developer, it is good to practice "manipulate an array without making a copy". map can be quite performance intensive when working with big arrays.
Learning exercises are not meant to be solved in the best way possible like practice exercises. They are meant to be solved with the concepts they are teaching to practice. Also learning exercises are primarily made for students that do not know JavaScript yet. If you are already familiar with the language, you can either solve the early learning exercises quickly if you are interested in some of the later concepts or you can just turn off learning mode altogether and focus on the practice exercises.
For loops are by no means something from the past. If you are writing code where performance is critical, where an existing array is modified or where the length of the array can change during the iteration process, you will still see for loops being used in modern JavaScript code.

To expand on @junedev 's comment, which I agree with, the most important reason is really that this exercise is about for loops. I want to re-iterate that. It doesn't matter if you already know for loops or understand them. As part of the syllabus, you must show your knowledge of for loops.
In the same way, we also have an exercise where you're forced to use a nice abstraction like map, where the goal is to use a map.
In practice exercises, however, do what you want :)


debugger

[ ] debugger interaction
[ ] set of programs outside of simulator and loading them

5x2 debug
5x5 pattern on left side
5x7tile map on right side


Error: React Hook "useRouter" is called conditionally. React Hooks must be called in the exact same order in every component render.

The error below is being thrown on every auth route component (i.e https://github.com/vercel/nextjs-subscription-payments/blob/main/components/ui/AuthForms/Signup.tsx)
Error: React Hook "useRouter" is called conditionally. React Hooks must be called in the exact same order in every component render.
It's due to this line of code:
const router = redirectMethod === 'client' ? useRouter() : null;
If you want to provide the option of redirecting based on server/client should this const instead be assigned with a useEffect/useState?
Or would it be safe just to assigned it as:
const router = useRouter()

I found just separating out the ternary and replacing the router uses where the error highlights fixed this :
const router = useRouter();   let routerMethod = redirectMethod === 'client' ? router : null;


Don't load votes and results if proposal is pending

Continued in https://github.com/snapshot-labs/snapshot/pull/430


support for media_player.media_seek?

I have a request to resume Yoto player last played media at the last played position, upon button press. So far, I have an automation to save the media_content_id and the media_position to helpers. I have another automation on button press to play_media with the media_content_id, but media_seek is unsupported. Is that possible?

I should be able to add media seek.   I'm not sure if that will resume between media to the spot you left off though.  Does it do that for other media integrations in HA?

Yes, I’ve just tested media player: seek on my Apple TV and it seeks to a different position.

On Dec 3, 2024, at 8:04 PM, cdnninja @.***> wrote:
I should be able to add media seek. I'm not sure if that will resume between media to the spot you left off though. Does it do that for other media integrations in HA?
—
Reply to this email directly, view it on GitHub https://github.com/cdnninja/yoto_ha/issues/140#issuecomment-2515999585, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHV5IYU3V6SN4DX3VRAKN7L2DZPMNAVCNFSM6AAAAABS7AN7GGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJVHE4TSNJYGU.
You are receiving this because you authored the thread.

I have added seek to the latest release.   Let me know if it works correctly for you.

When I send the seek action with the media_position, it switches to playing
and then idle immediately. Too fast to know if it tried at the given
position, unsure why it would not continue playing.
On Wed, Dec 4, 2024 at 7:29 PM cdnninja @.***> wrote:

I have added seek to the latest release. Let me know if it works correctly
for you.
—
Reply to this email directly, view it on GitHub
https://github.com/cdnninja/yoto_ha/issues/140#issuecomment-2518890510,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHV5IYUMTEHHD3OLQM3IF2L2D6T53AVCNFSM6AAAAABS7AN7GGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJYHA4TANJRGA
.
You are receiving this because you authored the thread.Message ID:
@.***>

Is this with an automation? So a play call right before it?
The seek command is actually a play command with a time added to it.  So an automation that plays followed by seek is two play commands back to back.

Yes, I had play and then seek. I just tried seek only, but it said the seek command doesn't allow key media_content_id. That's what I was using in the play action to resume whatever book was playing before (another automation saves media_content_id and media_position to helpers when Yoto stops playing).

Seek works for me but yes you can't pass content id.  I tested and it works for currently playing content.   It can't select.
Let me see if I can add a custom field on play content to have the start at time passed in a single command.
I bet your automation would work if you waited between commands but that is clunky.

You're right, this works with a minimum 3 second delay. Thank you very much for working on this.

Looks like I can't add a value. Home assistant doesn't let me.  One solution is to leverage how I fixed the chapter aspect.
Media ID for yoto is actually 3 parts.   Card, chapter and track.   Since I couldn't pass three fields you probably noticed I just used dashes.  The code checks for each item. If one is missing just starts at 1.  So if only card is passed it starts at the start of the card,  chapter 1.   If you pass chapter it obeys.
I could add a forth element, time.  So card-chapter-track-starttime.   If start time is missing it would start at 0.  If present it would obey it.
Thoughts?

That makes perfect sense to me
On Fri, Dec 6, 2024 at 5:16 PM cdnninja @.***> wrote:

Looks like I can't add a value. Home assistant doesn't let me. One
solution is to leverage how I fixed the chapter aspect.
Media ID for yoto is actually 3 parts. Card, chapter and track. Since I
couldn't pass three fields you probably noticed I just used dashes. The
code checks for each item. If one is missing just starts at 1. So if only
card is passed it starts at the start of the card, chapter 1. If you pass
chapter it obeys.
I could add a forth element, time. So card-chapter-track-starttime. If
start time is missing it would start at 0. If present it would obey it.
Thoughts?
—
Reply to this email directly, view it on GitHub
https://github.com/cdnninja/yoto_ha/issues/140#issuecomment-2524596892,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHV5IYRDN65GWLIZ4NHWNQD2EIV5VAVCNFSM6AAAAABS7AN7GGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRUGU4TMOBZGI
.
You are receiving this because you authored the thread.Message ID:
@.***>

Done.  Latest version now supports an additional value of start time.   Let me know if that works and we can close this one out.

That works in one automation step now! Thank you.

Excellent glad to hear!


fixing crash on settings import when kafka-python isn't installed

https://github.com/scrapinghub/frontera/issues/173

[Current coverage][cc-pull] is 47.63%

Merging [#174][cc-pull] into [master][cc-base-branch] will decrease coverage by 0.19%

@@             master       #174   diff @@
==========================================
  Files            72         72
  Lines          4453       4465    +12
  Methods           0          0
  Messages          0          0
  Branches        518        522     +4
==========================================
- Hits           2130       2127     -3
- Misses         2244       2258    +14
- Partials         79         80     +1

Powered by Codecov. Last updated by [62d9e49...d19f1c9][cc-compare]
[cc-base-branch]: https://codecov.io/gh/scrapinghub/frontera/branch/master?src=pr
[cc-compare]: https://codecov.io/gh/scrapinghub/frontera/compare/62d9e4995dcd5c72172d62611da716ce96f2b978...d19f1c9e268d09d8bba2b9277583eae66fd4eaed?src=pr
[cc-pull]: https://codecov.io/gh/scrapinghub/frontera/pull/174?src=pr


Add a new option to list all files, regardless of their extension

Similar to countfiles -fe, but allowing to list any files, with or without extension in their file names.
E.g.:
countfiles -l DIRPATH
countfiles --list-files DIRPATH

The other parameters (recursion/no-recursion, include-hidden) would be in place as usual.

We can reorganize the display of results in this way:
A) File counting by extension

table (listing file extension frequencies) - enabled by default

Sort alphabetically
Sort by frequency - enabled by default

total (just a summary)
list (--list-files, list of all found file paths, list with file size info)

withoutl file preview

B) File searching by extension

list (--list-files, list of all found file paths, list with file size info)- enabled by default

Optional file preview - not enabled by default
Optional size specification for file preview

total (just a summary)

instead of "-nt" and "-nl" there will be common arguments "-t"(--total) and "-l"(--list-files)
Used functions:
if extension:
    if args.preview and args.list_files:
        if not is_supported_filetype(extension):
            parser.exit(status=0, message=not_supported_type_message)
    if args.list_files:
        # getting data list
        data = (f for f in search_files(dirpath=location, extension=extension,
                                        include_hidden=include_hidden, recursive=recursive))
        # display result in chosen view mode
        len_files = show_result_for_search_files(files=data, list=True,
                                                 preview=args.preview, preview_size=args.preview_size)

    # total
    if args.total:
           # or use def search_files() or make a function that will only count the number of files,
           # and not return file paths.
          data = (f for f in search_files(dirpath=location, extension=extension,
                                        include_hidden=include_hidden, recursive=recursive))

          len_files = show_result_for_search_files(files=data, list=False,
                                                 preview=args.preview, preview_size=args.preview_size)

if all extensions

if args.list_files:
        if args.preview and not args.no_list:
            if not is_supported_filetype(extension):
                parser.exit(status=0, message=not_supported_type_message)
        # getting data list
        data = (f for f in search_files(dirpath=location, extension='',
                                        include_hidden=include_hidden, recursive=recursive))
        # display result in chosen view mode
        len_files = show_result_for_search_files(files=data, list=True,
                                                 preview=False, preview_size=args.preview_size)

if args.table:
    data = count_files_by_extension(location, include_hidden=include_hidden, recursive=recursive)
     if sort_alpha:
          show_2columns(sorted(data.items()))
     else:
           show_2columns(data.most_common())

if args.total:
        data = count_files_by_extension(location, include_hidden=include_hidden, recursive=recursive)
        return show_total(data)

So, if I understood correctly, you propose that we add a new option (like -l or --list-files) that would be common to both files counting and file searching. That option would therefore be off by default (i.e. the user will only see the list of file paths when the command --list-files is included. One inconvenient of that approach is that for a large number of files, we get (again) no feedback by default to the user during that process (but that could be mitigated with some other visual feedback).
Another option would be to keep the file list by default, and add it to the file counting routine, before displaying the summary table. This would have the advantage of giving instant feedback to the user, by using the generator approach we already have in place for the file searching. The current -nlor --no-listoption would allow to turn off the file list in both cases.
Do you think it makes sense to include a table for file searching? It would have only one line plus the total, I see no need for that, and in fact unless we have a good reason, I prefer the current, more "natural-language" like, approach. One possible justification for that approach would be to stop thinking of 2 separate groups/features (counting and searching) and have a single feature (search and count) with all the options, being one of them the option to filter by extension (i.e., the current -fe).
What do you think?

Now:
A) File counting by extension
default: table (no feedback)
no-table (no feedback) - total number

also a list can be here

B) File searching by extension
default: list (feedback)
no-list (no feedback) - total number and file sizes info

tables are not required here

A) File counting by extension
This option is possible:
For the table/no-table, you may need to add feedback.
But if the user chose a table, then perhaps it is not worth printing a list.
We take an already existing generator.
We use the def count_file_extensions() separately to print the found extensions. This returns a counter for def show_2columns() and def show_total().
def count_file_extensions(files, feedback: bool):
    from collections import Counter
    counters = Counter()
    for f in files:
        extension = get_file_extension(f)
        if extension == '.':
            extension = '[no extension]'
        counters[extension] += 1
        if feedback:
            print(extension)
    return counters

in def main_flow():
    # ...or do other stuff, i.e., counting files.
    # data = count_files_by_extension(location, include_hidden=include_hidden, recursive=recursive)
    data = (f for f in search_files(dirpath=location, extension=extension,
                                        include_hidden=include_hidden, recursive=recursive))

    data = count_file_extensions(data, feedback=True)

    if show_table:
        if sort_alpha:
            show_2columns(sorted(data.items()))
        else:
            show_2columns(data.most_common())
        # it returns None
    else:
        return show_total(data)

print for table:
Recursively counting all files, ignoring hidden files and directories, in C:\Users\Net/Count-files/tests

txt
py
txt
. . .
[no extension]
txt
txt
xlsx
pyc
pyc
pyc
pyc
 EXTENSION      | FREQ.
----------------+-------
 txt            |    13
 py             |     6
 [no extension] |     5
 pyc            |     4
 gz             |     3
 md             |     2
 html           |     1
 json           |     1
 css            |     1
 woff           |     1
 dat            |     1
 xlsx           |     1
----------------+-------
 TOTAL:         |    39
----------------+-------

print for no-table:
Recursively counting all files, ignoring hidden files and directories, in C:\Users\Net/Count-files/tests

txt
py
txt
py
. . .
py
json
md
gz
css
gz
txt
gz
woff
[no extension]
py
dat
txt
[no extension]
txt
[no extension]
txt
txt
xlsx
pyc
pyc
pyc
pyc
Total number of files in selected directory: 39.

B) File searching by extension
list:
feedback is present
no-list
If the user does not want the list, then just print a notification like "you need to wait".
And give a beep when the data is ready ( joke :) .
I was thinking about how to make a progress indicator. But in this case we need to know the amount of work.

I don't like the list of extensions as a way to provide feedback. I would prefer the full file path, or current directory path, followed by files contained in it. Another option, compatible with most terminals, would be to print all the file paths to the same console line, by using the carriage return (something like print(filepath, end="\r")). In most systems, this would take just one or two lines in the screen, rapidly changing through each file found. In a few rare cases (like in Pythonista for iOS), the end="\r") part may happen to be ignored, printing each file path into a new line. No big deal. In the end, that text line would be cleared and replaced by the final table and/or total.
I still think it would be a nice addition to have the option to list all files, regardless of their extension.
I don't think it would be easy to add a progress indicator here, at least one that would show the current stage, because to know in advance the amount of work, we would need to traverse the filesystem twice. The alternative would be to display the current folder/file, as described above, or an indeterminate progress indicator (something like spinning bars, blinking dots...). Anyway, the current folder/file seems to be the better option, as it shows the computer working as goes through files and displays some potentially useful information on which part of the filesystem is being scanned.
One issue that may arise with this approach, however, is when we have a long wait without any files being found. That won't be a problem if we choose to print always the current working directory (even if no matching files were found there) and the matching files as they are found. Not sure it it will slow down significantly the operation, but if it has just a little impact, I think if can become more user friendly.

Well, then:
def count_file_extensions(files, feedback: bool):
    from collections import Counter
    counters = Counter()
    for f in files:
        extension = get_file_extension(f)
        if extension == '.':
            extension = '[no extension]'
        counters[extension] += 1
        if feedback:
            print(f)
    return counters

Yes, but in order to make each file path replace the previous one, as discussed above:
        if feedback:
            print(f, end="\r")

on Windows does not work.
You can do it.

What happens on Windows?

cmd -> prints the all list( filepath \ n filepath ...)
PowerShell-> prints the all list, if it's big; if the list is small then prints in one line.

Can you post a screenshot or a copy of the output?

Also, can you please test also with end=""?

print(f, end="\r")
print()one line, last line looks weird:
C:\Users\Net/Desktop\Новая папка\hidden_py\test_file.pycxooth.LNK.txthon-35.pycpycypgSet 65500.epsview.jpg

C:\Users\Net\Count-files>python countfiles ~/Desktop

Recursively counting all files, ignoring hidden files and directories, in C:\Users\Net/Desktop

C:\Users\Net/Desktop\Новая папка\hidden_py\test_file.pycxooth.LNK.txthon-35.pycpycypgSet 65500.epsview.jpg
 EXTENSION      | FREQ.
----------------+-------
 py             |   298
 txt            |    48
 . . .
 png            |     1
 LNK            |     1
----------------+-------
 TOTAL:         |   436
----------------+-------

many files:
C:\Users\Net\Count-files>python countfiles ~/.PyCharmCE2016.3

Recursively counting all files, ignoring hidden files and directories, in C:\Users\Net/.PyCharmCE2016.3

C:\Users\Net/.PyCharmCE2016.3\config\plugins\BashSupport\classes\com\ansorgit\plugins\bash\documentation\SystemInfopageDocSource$MyCapturingProces
C:\Users\Net/.PyCharmCE2016.3\config\plugins\BashSupport\classes\com\ansorgit\plugins\bash\editor\BashSpellCheckingSupport$BashHeredocTokenizer.cl
. . . prints all paths
EXTENSION                       | FREQ.
---------------------------------+-------
 py                              |   551
 class                           |   548
. . .
dll                             |     1
 x                               |     1
---------------------------------+-------
 TOTAL:                          |  2331
---------------------------------+-------

print(f, end="")
prints all the paths in one heap.
C:\Users\path/file.txtC:\Users\path\file.pyC:\Users. . .

Ok. I think I know what’s going on. The carriage return character (“\r”) moves the carret to the left. But then we get a shorter file path and part of the previous text is not completely overwritten. So, we need to make sure that the remaining text is overwritten by spaces.
Please try this:
print("\r"+f.ljust(400), end="")

print("\r"+f.ljust(400), end="")

prints all paths
It is enough to work. Tomorrow I'll think about it and see examples on the Internet. Good night.

Ok. I did a small change based in the latest codebase. Please check it out. I did not add the feedback argument, though.

@NataliaBondarenko, I think all stuff from this conversation is done and working as expected by now, right? I just want to make sure that there is nothing left, before closing the issue.

The argument no-list was added to search for files by a certain extension. The table is used to display the results of counting all files.
If we use def search_files, we can also add a list to count all the files. But def count_files_by_extension is a little faster.
def search_files can be optimized, but I still need to check it.
If we do not add the display list to the counting of files, we can close it.

Hm.. It works nice as it is. Maybe we could add something to the search arguments syntax, for the sake of completeness. I mean, we are abele to search files without extension, files with a specific extension, but we don't have a way to search for files with any extension (all extensions). I think we could add the option to search with -fe .. (2 dots) with the meaning of "all files, with any extension". What do you think, @NataliaBondarenko?

@NataliaBondarenko, I think that by now there is nothing left to do from this issue. It's all done, right?

It's all done.


Slack has 700+ users now

Migrated from GitLab: https://gitlab.com/meltano/meltano/-/issues/2552
Originally created by @DouweM on 2021-02-02 21:27:27

The homepage still says 600+.

View 1 previous comment from the original issue on GitLab


TypeError when using options in L.control.layers

In version 1.0.0-b1 I am noticing a very weird bug.
I am using this code to create a control layer with options
function generateMap(map) {
    var mapTiles = getMapTiles();
    var overlayMaps = getMaps();
    var options = {
        collapsed: false,
    };
    L.control.layers(mapTiles, overlayMaps, options).addTo(map);
}

When I include the options variable, rendering fails with the error `ncaught TypeError: Cannot read property 'y' of undefined.
the script works perfectly when I omit the options.
function generateMap(map) {
    var mapTiles = getMapTiles();
    var overlayMaps = getMaps();
    L.control.layers(mapTiles, overlayMaps).addTo(map);
}

Do you have a stack trace?

Stack trace
o.Control.Layers.o.Control.extend._expand	@	leaflet.js:8
o.Control.Layers.o.Control.extend._initLayout	@	leaflet.js:8
o.Control.Layers.o.Control.extend.onAdd	@	leaflet.js:8
o.Control.o.Class.extend.addTo	@	leaflet.js:8
generateMap	@	Map.js:119

Here's the stack trace on the unminified version retrieved from the dowloads page
L.Control.Layers.L.Control.extend._expand	@	leaflet.js:9112
L.Control.Layers.L.Control.extend._initLayout	@	leaflet.js:8957
L.Control.Layers.L.Control.extend.onAdd	@	leaflet.js:8885
L.Control.L.Class.extend.addTo	@	leaflet.js:8460
generateMap	@	Map.js:119

Aha. It seems that the layers control is asking the map size via this._map._size instead of this._map.getSize(). This is a trivial fix, so I'll let any newbie coder to make the change and issue a pull request.
Normally, _expand gets executed on a user interaction after the map size has been init'ed. But, in your case, collapsed:false means that the control tries to get the size as soon as possible, which in your case happens before any calls to L.Map.getSize().


Migrating to V4 - React Query Devtools module parse failed

Describe the bug
I have migrated to React Query V4. When I include @tanstack/react-query-devtools it displays error like below:
unitless.browser.esm.js:50 Uncaught Error: Module parse failed: Unexpected token (18:1274)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|    * @author Kent C. Dodds<EMAIL_ADDRESS>(https://kentcdodds.com)
|    */
> const o={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function s(e,n,t){return e=a(e,t),(n=a(n,t)).length>e.length?o.NO_MATCH:e===n?o.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase())===(n=n.toLowerCase())?o.EQUAL:e.startsWith(n)?o.STARTS_WITH:e.includes(` ${n}`)?o.WORD_STARTS_WITH:e.includes(n)?o.CONTAINS:1===n.length?o.NO_MATCH:function(e){let n="";return e.split(" ").forEach((e=>{e.split("-").forEach((e=>{n+=e.substr(0,1)}))})),n}(e).includes(n)?o.ACRONYM:function(e,n){let t=0,r=0;function s(e,n,r){for(let o=r,s=n.length;o<s;o++){if(n[o]===e)return t+=1,o+1}return-1}function a(e){const r=1/e,s=t/n.length;return o.MATCHES+s*r}const i=s(n[0],e,0);if(i<0)return o.NO_MATCH;r=i;for(let t=1,a=n.length;t<a;t++){r=s(n[t],e,r);if(!(r>-1))return o.NO_MATCH}return a(r-i)}(e,n)}function a(e,t){let{keepDiacritics:o}=t;return e=`${e}`,o||(e=e.replace(r,(e=>n[e]))),e}function i(e,n){let t=n;"object"==typeof n&&(t=n.accessor);const r=t(e);return null==r?[]:Array.isArray(r)?r:[String(r)]}const u={maxRanking:1/0,minRanking:-1/0};function c(e){return"function"==typeof e?u:{...u,...e}}e.compareItems=function(e,n){return e.rank===n.rank?0:e.rank>n.rank?-1:1},e.rankItem=function(e,n,t){if((t=t||{}).threshold=t.threshold??o.MATCHES,!t.accessors){const r=s(e,n,t);return{rankedValue:e,rank:r,accessorIndex:-1,accessorThreshold:t.threshold,passed:r>=t.threshold}}const r=function(e,n){const t=[];for(let r=0,o=n.length;r<o;r++){const o=n[r],s=c(o),a=i(e,o);for(let e=0,n=a.length;e<n;e++)t.push({itemValue:a[e],attributes:s})}return t}(e,t.accessors),a={rankedValue:e,rank:o.NO_MATCH,accessorIndex:-1,accessorThreshold:t.threshold,passed:!1};for(let e=0;e<r.length;e++){const i=r[e];let u=s(i.itemValue,n,t);const{minRanking:c,maxRanking:l,threshold:A=t.threshold}=i.attributes;u<c&&u>=o.MATCHES?u=c:u>l&&(u=l),u=Math.min(u,l),u>=A&&u>a.rank&&(a.rank=u,a.passed=!0,a.accessorIndex=e,a.accessorThreshold=A,a.rankedValue=i.itemValue)}return a},e.rankings=o,Object.defineProperty(e,"__esModule",{value:!0})}));
| //# sourceMappingURL=index.production.js.map
|
    at<EMAIL_ADDRESS>(unitless.browser.esm.js:50:29)
    at __webpack_require__ (bootstrap:63:1)
    at<EMAIL_ADDRESS>(devtools.js:8:24)
    at __webpack_require__ (bootstrap:63:1)
    at<EMAIL_ADDRESS>(index.js:5:16)
    at __webpack_require__ (bootstrap:63:1)
    at ./formEfficiencyReport/src/App.tsx (App.tsx:1:1)
    at __webpack_require__ (bootstrap:63:1)
    at ./formEfficiencyReport/src/index.tsx (index.tsx:1:1)
    at __webpack_require__ (bootstrap:63:1)

Your minimal, reproducible example
No response
Steps to reproduce
In package.json:
"@tanstack/react-query": "4.3.3",
    "@tanstack/react-query-devtools": "4.3.3",

In webpack.config.js:
const babelConfig = {
  presets: [
    [
      '@babel/preset-env',
      {
        targets: {
          browsers: [
            '> 1%',
            'last 2 chrome versions',
            'last 2 firefox versions',
            'last 2 safari versions',
            'last 2 opera versions',
            'not ie 11',
            'not op_mini all',
          ],
        },
      },
    ],
    '@babel/preset-react',
    '@babel/preset-typescript',
  ],
  plugins: [
    '@babel/plugin-proposal-optional-chaining',
    '@babel/plugin-transform-runtime',
    'styled-components',
    '@babel/plugin-proposal-class-properties',
  ],
};

rules: [
      {
        test: /\.(ts|tsx|style.ts|style.tsx|js|jsx)$/,
        resolve: {
          extensions: ['.ts', '.tsx', '.style.ts', '.style.tsx', '.js', '.jsx'],
        },
        exclude: [/node_modules/, /tsconfig.json/],
        use: {
          loader: 'babel-loader',
          options: { ...babelConfig },
        },
      },
      {
        test: /\.(mjs)$/,
        include: /node_modules/,
        type: 'javascript/auto',
      }]

Expected behavior
I expect to display React Query Devtools, but it displays error. When I'm not including devtools it works fine.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform

OS: Mac OS 12.3.1
Node 14.17.0
NPM 6.14.13

react-query version
4.3.3
TypeScript version
No response
Additional context
No response

show a runnable reproduction please. There were many issues already (search the closed issues!) and all were related to bundlers doing something wrong. Please also use the latest version of react-query

@TkDodo I guess it might be connected with the fact that match-sorter-utils are living inside @tanstack/table repo and have previous setup in regards to ems module handling.
We removed the browser entry from package.json in query because of this issue that some bundlers were picking umd build instead of esm

true - we are not using a fixed version dependency:
'@tanstack/match-sorter-utils': ^8.1.1

so are you saying this is an upstream issue with react-table 😅 ?

I've added link to Codesandbox but it works. I think it is problem in my webpack.config.js (see in codesandbox)

I would say yes.
I guess we could fix it either by reworking @tanstack/table monorepo esm support 😨, or moving  match-sorter-utils out of it.
@TommyNT codesandbox is using webpack 5. Which one do you use in your project?

@DamianOsipiuk I use webpack ^4.43.0 (in codesandbox is package.json with my dependencies and versions)

I guess we could fix it either by reworking @tanstack/table monorepo esm support

here we go again 😆. Can we reproduce the setup we have in query?

When I am using esm-loader in
module: {
    rules: [
      {
        test: /\.(ts|tsx|style.ts|style.tsx|js|jsx)$/,
        resolve: {
          extensions: [".ts", ".tsx", ".style.ts", ".style.tsx", ".js", ".jsx"]
        },
        exclude: [/node_modules/, /tsconfig.json/],
        use: {
          loader: ["babel-loader", "esm-loader"],
          options: { ...babelConfig }
        }
      }

It displays other error but it also relates to<EMAIL_ADDRESS>unitless.browser.esm.js:50 Uncaught Error: Module build failed (from ./node_modules/esm-loader/esm-loader.mjs):
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/xxxxxx/node_modules/esm-loader/esm-loader.mjs
    at Module.load (:10090/pl/formlib/formsReports/internal/modules/cjs/loader.js:931:11)
    at Function.Module._load (:10090/pl/formlib/formsReports/internal/modules/cjs/loader.js:774:14)
    at Module.require (:10090/pl/formlib/formsReports/internal/modules/cjs/loader.js:957:19)
    at require (:10090/Users/xxxxxxnode_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at loadLoader (:10090/Users/xxxxxx/node_modules/loader-runner/lib/loadLoader.js:18:17)
    at iteratePitchingLoaders (:10090/Users/xxxxxx/node_modules/loader-runner/lib/LoaderRunner.js:169:2)
    at runLoaders (:10090/Users/xxxxxx/node_modules/loader-runner/lib/LoaderRunner.js:365:2)
    at NormalModule.doBuild (:10090/Users/xxxxxx/node_modules/webpack/lib/NormalModule.js:295:3)
    at NormalModule.build (:10090/Users/xxxxxx/node_modules/webpack/lib/NormalModule.js:446:15)
    at Compilation.buildModule (:10090/Users/xxxxxx/node_modules/webpack/lib/Compilation.js:739:10)
    at :10090/Users/xxxxxx/node_modules/webpack/lib/Compilation.js:981:14
    at :10090/Users/xxxxxx/node_modules/webpack/lib/NormalModuleFactory.js:409:6
    at :10090/Users/xxxxxx/node_modules/webpack/lib/NormalModuleFactory.js:155:13
    at AsyncSeriesWaterfallHook.eval [as callAsync] (eval at create (:10090/Users/xxxxxx/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at :10090/Users/xxxxxx/node_modules/webpack/lib/NormalModuleFactory.js:138:29
    at :10090/Users/xxxxxx/node_modules/webpack/lib/NormalModuleFactory.js:346:9
    at processTicksAndRejections (:10090/pl/formlib/formsReports/internal/process/task_queues.js:77:11)
    at<EMAIL_ADDRESS>(unitless.browser.esm.js:50:29)
    at __webpack_require__ (bootstrap:63:1)
    at<EMAIL_ADDRESS>(devtools.js:8:24)
    at __webpack_require__ (bootstrap:63:1)
    at<EMAIL_ADDRESS>(index.js:5:16)
    at __webpack_require__ (bootstrap:63:1)
    at ./formEfficiencyReport/src/App.tsx (App.tsx:1:1)
    at __webpack_require__ (bootstrap:63:1)
    at ./formEfficiencyReport/src/index.tsx (index.tsx:1:1)
    at __webpack_require__ (bootstrap:63:1)
    ```

The same issue is in #4278

I am completely new to React Query, trying to add it to my project, and having the same issue as @TommyNT with 4.13.4 and 4.13.5. It seems React Query 3 works just fine with the devtools, and React Query 4.x works fine without it.

I am completely new to React Query, trying to add it to my project, and having the same issue as @TommyNT with 4.13.4 and 4.13.5. It seems React Query 3 works just fine with the devtools, and React Query 4.x works fine without it.

Hi,
I actually work on React Query v3 and it's fine, but I would like to migrate to v4. It seems that RQ v4 works on Webpack v5

I also had this issue when migrating from v3 => v4.  This issue is for webpack 4 environments I think, which use acorn 6, and doesn't support nullish coalescing yet.
I had the exact same error as the original author - if you look at the error message @TommyNT  you'll see the place of code referenced: Unexpected token (18:1274)  which if you open up node_modules, you can find the exact place of code, which traces to this line in match-sorter-utils: https://github.com/TanStack/table/blob/main/packages/match-sorter-utils/src/index.ts#L85
  options.threshold = options.threshold ?? rankings.MATCHES

If I just replace the ?? with || locally in my node_modules, I was able to see the problem resolved, just to test.  It's worth trying that to confirm there's nothing else going on.
As far as resolution, I was able to fix by forcing a resolution for acorn 7, which does support nullish coalescing.  See the webpack issue with someone mentioning that fix:  https://github.com/webpack/webpack/issues/10227.  In your package.json, if your config supports resolutions, you can do:
  "resolutions": {
      "acorn": "npm:acorn-with-stage3"
  }

Otherwise, you could probably apply @babel/plugin-proposal-nullish-coalescing-operator or something similar to process the ?? of this file.

Just noting, I actually had other issues related to upgrading acorn (which I'm pretty confused about) so I ended up just targeting match-sorter-utils to be run through our webpack babel-loader.
Something like
  test: /\.js$/,
  include: /node_modules\/@tanstack\/match-sorter-utils/,
  use: ['babel-loader'],

And then make sure to include @babel/plugin-proposal-nullish-coalescing-operator in your babel config

As far as resolution, I was able to fix by forcing a resolution for acorn 7, which does support nullish coalescing. See the webpack issue with someone mentioning that fix: webpack/webpack#10227. In your package.json, if your config supports resolutions, you can do:
  "resolutions": {
      "acorn": "npm:acorn-with-stage3"
  }

Otherwise, you could probably apply @babel/plugin-proposal-nullish-coalescing-operator or something similar to process the ?? of this file.

@peterkrieg Thanks for this! I ran into this same issue when trying to install and use downshift. Your solution worked a treat :)
Just to add that, after changing my config, I needed to delete my node_modules dir and then yarn install for it to pick up the change.

Hmm, might have spoken too soon - that resolutions fix seems to have broken my React Styleguidist install:
main.bundle.js:19505 Uncaught TypeError: plugins[i] is not a function
    at Function.extend (main.bundle.js:19505:62)
    at ./node_modules/acorn-stage3/index.js.module.exports (main.bundle.js:25591:17)
    at ./node_modules/acorn/index.js (main.bundle.js:25723:16)
    at __webpack_require__ (main.bundle.js:790:30)
    at fn (main.bundle.js:101:20)
    at ./node_modules/buble/dist/buble-browser.es.js (main.bundle.js:29785:63)
    at __webpack_require__ (main.bundle.js:790:30)
    at fn (main.bundle.js:101:20)
    at ./node_modules/react-styleguidist/lib/client/utils/compileCode.js (main.bundle.js:154943:63)
    at __webpack_require__ (main.bundle.js:790:30)

Maybe I'll try upgrading to Webpack 5 and hope that fixes the issue.

Just noting, I actually had other issues related to upgrading acorn (which I'm pretty confused about) so I ended up just targeting match-sorter-utils to be run through our webpack babel-loader.
Something like
  test: /\.js$/,
  include: /node_modules\/@tanstack\/match-sorter-utils/,
  use: ['babel-loader'],

And then make sure to include @babel/plugin-proposal-nullish-coalescing-operator in your babel config

@peterkrieg thank you! This solution works

Hey @globalmatt yeah I think that original solution was flawed, perhaps webpack 4 isn't compatible with updated acorn after all.  I edited my original comment to instead recommend parsing the match-sorter-utils through babel to convert the problematic ??.  Does that work for you?
I do wonder if there's a bit of a mismatch in js target version here - the rest of react-query code gets converted to older version of JS features (aka, nulllish coalescing will get converted out for example).  I feel like to keep consistent with rest of library the match-sorter-utils should match the same transpile target as tanstack/query - what do you think @TkDodo ?

match-sorter-utils is referenced here, like all other dependencies:
https://github.com/TanStack/query/blob/667efe37a3c2fcf82aa37fb44aa046687be04501/rollup.config.ts#L117-L129
Again, this is an upstream issue. match-sorter-utils doesn't define exports in package.json, and webpack4 also has an issue to pick up the "wrong stuff", so this kind of confuses bundlers.
I don't see much action going on over in the table repo, so the 3 possible solutions are to me:

make a PR to match-sorter-utils that fixes esm exports
copy the code of match-sorter-utils over to the query devtools and we treat it like any other source code that we own
set the match-sorter-utils dependency fixed to 8.1.1, _not: ^8.1.1 - because that version was still working.

Thoughts @DamianOsipiuk ?

I found a couple of issues opened in the table repo regarding bundlers picking up UMD bundle and failing to parse it.

make a PR to match-sorter-utils that fixes esm exports

I think we would only need to remove browser field from package.json and it should solve the problem for bundlers.
If we do not add exports field, newer bundlers should fall back to module or main

copy the code of match-sorter-utils over to the query devtools and we treat it like any other source code that we own

It needs to be deployed as a separate package, cause both reac-query-devtools and vue-query use it. Not mentioning table (and possibly router?). Maybe in this case it would be better to extract it from table monorepo and make it as a separate standalone repository?

set the match-sorter-utils dependency fixed to 8.1.1, _not: ^8.1.1 - because that version was still working.

I do not see any changes related to this after 8.1.1. Are you sure this will help? If it works, this could be a temporary fix until the problem will be fixed in table.

I think we would only need to remove browser field from package.json and it should solve the problem for bundlers.

maybe, but then they wouldn't support ESM. I think the proper fix would be to add exports, no ?

I do not see any changes related to this after 8.1.1. Are you sure this will help? If it works, this could be a temporary fix until the problem will be fixed in table.

8.5.14 is the latest release, and things definitely worked some time ago. There is no other release between 8.5.14. and 8.1.1 so my guess is that is the culprit.

@TommyNT @peterkrieg @globalmatt @Bre77
can you please try it out with the preview build from the attached PR to see if it fixes the issue?
"@tanstack/react-query": "https://pkg.csb.dev/TanStack/query/commit/e8fc0458/@tanstack/react-query",
"@tanstack/react-query-devtools": "https://pkg.csb.dev/TanStack/query/commit/e8fc0458/@tanstack/react-query-devtools",

thanks

@TkDodo  that fixed  it for me, thank you!


Text align classes improvements

Text align classes should use !important or there should be extra classes for this purpose.
Also would be useful to have device specific alignment classes; like
.text-left-xs
.text-right-md
.text-center-lg

and all others etc. hehe

I don't think this is something which would be added in V3 as it is essentially feature frozen. The core team though will be able to consider this for V4 though.

I wouldn't want an !important declared in the framework unless its absolutely necessary as it can limit the flexibility of overwriting.

Been asked for before and we won't be doing it for v3. Maybe v4, but even there we don't have anything in the pre-alpha builds yet.