Encrypted data serialization/deserialization compatibility tests

We must always be able to decrypt old versions of encrypted data written to Kafka.
Eventually we may want to upgrade to a new encryption version, to do this we need new versions of the filter to be able to write the old encryption version while the filters are rolling out. It would be good to have independent verification that the bytes written at each encryption version are schema compatible.

Currently we test the encryption/decryption roundtrip but we are lacking proof that we can decrypt older binary data. We need to check that we can decode directly from some exemplar binary, rather than using the current codebase to generate examples, because our encrypt/decrypt may be logically consistent but producing bytes that are no longer schema compliant.
It could also be good to have a test independently verifying what is serialized on the encrypt path too. Maybe comparing against checked-in examplars. It would be good to have independent verification that the bytes written out at each encryption version are what we expect. This is because during an upgrade of the filter we want to continue emitting an older serialization format that will be readable by old versions of the filter.

We decided that we've done enough for 0.5.0 by adding integration tests decrypting binary examples encrypted with a pre-existing key. We will spawn further cards for the future to improve the unit testing.
It is hard to separate encryption from serialization given how we are trying to conserve buffers, so we may want to implement something like a Null Cipher to try and make the work deterministic for tests.


Docs: Readme

Added a link to the site and added a link to shields contributing
Related Issues
Closes #

Type of Change

[ ] 🐛 Bug fix or ⚙ enhancement
[ ] ✨ New feature or Chore (change with no new features or fixes)
[ ] 📚 Documentation update

Checklist (select as many as applicable)

[ ] The code follows the style guidelines of this project.
[ ] All new and existing tests pass.
[ ] This pull request is ready to be merged and reviewed.

Thank you. Please update and fix conflicts.

I am a newbie, please explain how to do it. I made changes via edit not via terminal. Thank you


add oci conformance test gitaction

Signed-off-by: Wang Yan<EMAIL_ADDRESS>

@wy65701436 just wondering we should probably add the badge to README, too.
[![](https://github.com/<org>/<repo>/workflows/oci-distribution-conformance/badge.svg)](https://github.com/<org>/<repo>/actions?query=workflow%3Aoci-distribution-conformance)


Minor changes

This is a collection of minor changes including

Using semicolons consistently
Add/Remove spaces
Fix some variable names in comments

@KamasamaK thanks for the PR. Especially for doing it on 3.17 as well.


Search scope to upper case

Needed to change "notes" to uppercase
 val scope = GlobalSearchScope.filesScope(project, virtualFileContainer.getFiles(), "notes")

I would like to work on this @epm-dev-priporov, assign it to me.

So @epm-dev-priporov , I need to change the "notes" to upper case("NOTES") ? is that the issue. if not could you please brief me the issue.

@gantanikhilraj to "Notes"

All other scopes start from upper latter, the same is expected for the plugin scope


[QoI] Don't assume that contextual type is always present for trailing closure diagnostics

Fixes crasher in diagnostics related to the fact that contextual type
is not always available when trying to diagnose problems related to
calls with trailing closures.
Resolves: rdar://problem/33067102

@swift-ci please smoke test

@rudkx Thanks!


hasmore function, pagintation?

Hello!
I've been using the app for quite a while now. I noticed that it has a "hasMore" function, which is for pagintation right?
Although i can't get it to work... Where can i set the limit? How can i show only, for example, 3 results and then press a next button to show the next 3 results?
Thank you very much for your help!

in the Controllers at func subscriptions and index, simply override this value
sort.limit = this.limit();
to
sort.limit = 3;
Thanks

i've changed the value of sort.limit but it doesn't work.
I change the increment value in the MeteorisController but it changes back to 15 automatically when i run the app.
thank you

Editing the increment value worked, but now a button should appear to load more results, but doesnt.
thank you!

which one from my answer did you used @marcojferreirac ?

Editing the MeteorisController increment value. But now, even if my collection has 10 fields, i can only access 3. The others aren't loaded/can't be accessed.

loadmore button also not showing?

yes, the loadmore button doesn't appear.

can You Please give your code at MeteorisController and YourController?

My MeteorisController code is the same as the one in gitHub, only changed "increment: 3".
My controller's code is the generated code, only changing the sort.limit in the "subscriptions" function, like below:
subscriptions: function() {
var sort = MeteorisGridView.getSorting();
sort.limit = 3;
    this.subs.subscribe('ccdocs', {});
    this.subs.subscribe('descriptions', {});

    this.subscription = this.subs.subscribe('items', this.getCriteria(), sort);
},

Hi @marcojferreirac, I think you get me wrong. You shouldn't change the sort limit inside subscribe function, that will just subsrcibe 3 data from server and no more hardcoded. I mean you must change the MeteorisController itself, not the child. And you should change the increment variable value, not the limit.


npm install error when trying to run renovate

On the latest release of renovate, at the Spawning npm install to create /tmp/tmp-string/package-lock.json step I'm getting this error:
module.js:471
           throw err;
           ^

       Error: Cannot find module '/home/renovate/node_modules/.bin/npm'
           at Function.Module._resolveFilename (module.js:469:15)
           at Function.Module._load (module.js:417:25)
           at Module.runMain (module.js:604:10)
           at run (bootstrap_node.js:389:7)
           at startup (bootstrap_node.js:149:9)
           at bootstrap_node.js:504:3

I believe it is due to this line here which is referencing the npm binary relatively from the directory the renovate command was executed in:
https://github.com/singapore/renovate/blob/f9b12dbb3eb95b06b4914feb692243dda75b1a40/lib/workers/branch/npm.js#L15

Hmm that's true. I wanted to bundle yarn and npm to overcome versioning problems but need a way to reliably require it

I believe you can simply add npm as a dependency in package.json and require it that way

Yes it's a listed dependency already which is then spawned. But I should derive the executable in a way that gives the correct absolute path.

@Autre31415 can you try latest release and see if it's resolved?


Errors Endpoint

New Endpoint Proposal: Fetching Job Errors
Issue Type: Feature Request
Description:
As we continue to evolve the AsyncFlow library, it's become apparent that there's a potential gap in our error-handling capabilities. Currently, while users can track the status of their jobs, there isn't a straightforward way to fetch detailed error information in case a job fails. This can be invaluable for both developers and end-users to understand what might have gone wrong.
Proposal:
Introduce a new endpoint:
/{flowName}/{jobId}/error
This endpoint will return detailed error information if the corresponding job encounters a failure.
Response Structure (proposed):
{
    "JobId": "unique-job-id",
    "Error": {
        "Type": "ExceptionType",
        "Message": "Detailed error message",
        "StackTrace": "Stack trace details..."
    }
}

Customization:
In line with the ethos of flexibility that AsyncFlow offers, we should also provide users with the ability to customize the error response. This can be achieved by incorporating a Func<Exception, IResult> within the AsyncFlowEndpointConfigurator, allowing users to modify the default error output or even introduce additional logging mechanisms.
Benefits:

Provides clearer insights into job failures.
Enhances user experience by offering detailed feedback.
Allows users to tailor error outputs, making it adaptable for various applications.

Implementation Steps (tentative):

Design the endpoint structure.
Integrate it with the job execution flow to capture and relay errors.
Implement the customization mechanism through AsyncFlowEndpointConfigurator.
Update documentation and provide examples.

closed by commit
https://github.com/TheFo2sh/AsyncFlow/pull/4


Pagination query count bug

Package
filament/filament
Package Version
v2.16.54
Laravel Version
v9.43.0
Livewire Version
v2.10.7
PHP Version
PHP 8.1.10
Problem description
Problem with query to generate pagination in case of [-1] (all records). In this case $query-count() is called to fill the perPage parametr on line 33 - CanPaginateRecords.php When you have some GROUP BY statement in query this doesnt work. The reason is that the result SQL statement dont have whole query in subquery and aggregate function counting through the grouped results. Result is count of all records of first row from query.
SQL Example:
select count(*) as aggregate from to_invoiceleft jointo_invoice_toggl_ac_entries_bindonto_invoice.id=to_invoice_toggl_ac_entries_bind.to_invoice_idleft jointoggl_ac_entries_bindonto_invoice_toggl_ac_entries_bind.toggl_entry_id=toggl_ac_entries_bind.toggl_entry_idgroup byto_invoice.idorder byto_invoice.timestamp desc
Expected behavior
select count(*) as aggregate from (SELECT to_invoice.id FROM to_invoiceleft jointo_invoice_toggl_ac_entries_bindonto_invoice.id=to_invoice_toggl_ac_entries_bind.to_invoice_idleft jointoggl_ac_entries_bindonto_invoice_toggl_ac_entries_bind.toggl_entry_id=toggl_ac_entries_bind.toggl_entry_idgroup byto_invoice.idorder byto_invoice.timestamp desc) as subquery;
Steps to reproduce
Use some GROUP BY statement in query.
Reproduction repository
dont have yet
Relevant log output
No response

Did you ever solve this?

@hejcmichal Did you ever solve this? I'm running into a similar issue.

Not the best solution, but nevertheless the problem is solved.
protected function getTableRecordsPerPage(): int
    {
        if ($this->tableRecordsPerPage < 0){
            return<PHONE_NUMBER>9999999;
        } else {
            return $this->tableRecordsPerPage;
        }
    }


Binary wheel 'zhlyr-4.2-cp312-cp312-linux_x86_64.whl' has an unsupported platform tag 'linux_x86_64'.

setuptools version
69.5.1
Python version
3.12.3
OS
Ubuntu 22.04.4 LTS on Windows 10 x86_64
Additional environment information
This only happend in my linux
However, I'm not encountering this issue on my Windows system.
Description
When attempting to upload the wheel file "zhlyr-4.2-cp312-cp312-linux_x86_64.whl" using Twine, an error message is displayed indicating that the platform tag "linux_x86_64" is unsupported.
Expected behavior
i wanted to upload my library that contains some cython to pypi as first library for me
How to Reproduce
From Ubuntu OS :
1 - build my library that have cython files using python setup.py bdist_wheel
2 - upload library to pypi using twine
Output
Binary wheel 'zhlyr-4.2-cp312-cp312-linux_x86_64.whl' has an unsupported platform tag 'linux_x86_64'.

Hi @Gaoc3, could you please provide a minimal reproducible example. The methodology to create one is described in https://stackoverflow.com/help/minimal-reproducible-example.
Also please do not use the deprecated python setup.py bdist_wheel functionality. More information about the supported alternative in https://setuptools.pypa.io/en/latest/build_meta.html#how-to-use-it.

Hi @Gaoc3, could you please provide a minimal reproducible example? The methodology to create one is described in https://stackoverflow.com/help/minimal-reproducible-example.
Also please do not use the deprecated python setup.py bdist_wheel functionality. More information about the supported alternative in https://setuptools.pypa.io/en/latest/build_meta.html#how-to-use-it.
You should also list all your build dependencies (including setuptools itself and Cython) in pyproject.toml's [build-system] requires.
For compiling and publishing multi-platform wheels, a good place to start is by looking at https://cibuildwheel.pypa.io/en/stable/ (PyPI is likely to require wheels to be build on manylinux platform).

i used setup code contine this code :
from setuptools import setup, find_packages
from Cython.Build import cythonize
import os
import zhlyr
with open('README.md', 'r') as file:
    long_description = file.read()

# تحديد الدليل الذي يجب البحث فيه للملفات .pyx و .c و .so
base_dir = os.path.dirname(os.path.abspath(__file__))

pyx_files = [os.path.join(root, file) for root, dirs, files in os.walk(base_dir) for file in files if file.endswith('.pyx')]
pyc_files = [os.path.join(root, file) for root, dirs, files in os.walk(base_dir) for file in files if file.endswith('.c')]
pyso_files = [os.path.join(root, file) for root, dirs, files in os.walk(base_dir) for file in files if file.endswith('.so')]

setup(
    name='zhlyr',
    version='4.8',
    packages=find_packages(),
    install_requires=['requests', 'shazamio', 'shazam', 'cython'],
    ext_modules=cythonize(pyx_files),
    long_description=long_description,
    long_description_content_type='text/markdown',
    description='Python library for music handling',
    author='Mtsky',
<EMAIL_ADDRESS>    url='https://gaoc3.github.io/zhlyr/',
    license='MIT',
    classifiers=[
        "Development Status :: 1 - Planning",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: MIT License",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3",
        "Operating System :: Unix",
        "Operating System :: MacOS :: MacOS X",
        "Operating System :: Microsoft :: Windows",
    ],
    keywords=['lyrics', 'music', 'shazam', 'serialize', 'serializer', 'recognize'],
    python_requires=">=3.9",
    package_data={'zhlyr': pyso_files + pyc_files}
)

I'm sure that the Cython file has no errors. I tried it locally and it worked, but when I rebuild it with setuptools and then I want to upload it to pypi with twine through the command:
twine upload dist/*

But I see the message that I shared above. I tried to solve the problem using the manylinux Tools, but it uploads the library to only one distribution, which is Linux, and the update will not reach any distribution other than Linux. I mean, the update will not even reach any distribution other than Linux. I tried to update the library on Windows. Through the  bash pip install -U zhlyr command, it tells me that the library is in the latest version , even though it is not updated, and that the update does not reach the Windows distribution if the user tries to update it. What is the solution, please.

but it uploads the library to only one distribution, which is Linux, and the update will not reach any distribution other than Linux.

I think that is the expected behaviour. The ".whl" file (a.k.a the Python package binary distribution archive) built with Cython (and/or any C/Rust/Go etc...) is platform dependent so you need to build one ".whl" for each platform. Then you upload all of those files to PyPI.

I tried to update the library on Windows. Through the  bash pip install -U zhlyr command, it tells me that the library is in the latest version , even though it is not updated, and that the update does not reach the Windows distribution if the user tries to update it.

I suppose the wheel for Windows was never built and uploaded to PyPI, so pip on Windows cannot find any newer candidate.
I recommend checking https://cibuildwheel.pypa.io/en/stable/ to learn how to build and upload multiple distributions for all the mainstream platforms at the same time using a continuous integration service.
You can also upload the sdist so that users of non-mainstream platforms can still have a chance to compile the package themselves.

I am planning to move this thread to "Discussions" because I don't think there is a direct bug in setuptools here. The .whl file produced should be able to be installed in the same machine it is built, and Setuptools does not natively covers cross-compilation.
Using additional tools like cibuildwheel, on top of the existing setup.py that runs setuptools, is suggested to cover multiple platforms.
The choice of which platform tags PyPI wants to support is also not controlled by setuptools.

Using additional tools like cibuildwheel, on top of the existing setup.py that runs setuptools, is suggested to cover multiple platforms.

How i can do that? , please

but it uploads the library to only one distribution, which is Linux, and the update will not reach any distribution other than Linux.

I think that is the expected behaviour. The ".whl" file (a.k.a, wheel, the Python package binary distribution archive) built with Cython (and/or any C/Rust/Go etc...) is platform dependent so you need to build one ".whl" for each platform. Then you upload all of those files to PyPI.

I tried to update the library on Windows. Through the  bash pip install -U zhlyr command, it tells me that the library is in the latest version , even though it is not updated, and that the update does not reach the Windows distribution if the user tries to update it.

I suppose the wheel for Windows was never built and uploaded to PyPI, so pip on Windows cannot find any newer candidate.
I recommend checking cibuildwheel to learn how to build and upload multiple distributions for all the mainstream platforms at the same time using a continuous integration service.
You can also upload the sdist so that users of non-mainstream platforms can still have a chance to compile the package themselves.

I don't know how to use toml or cibuildwheel , only setuptools to built my library , is there any tutorials of that?

You can find the documentation for cibuildwheel in the links shared previously.


Runpod for stable diffusion error

I am getting Host error and I dont know why because it was running untill yesterday and I restarted the pod and it has been showing error for the last 30min.
Can you instruct me how to fix this?
(Disk volume is 60gb but at 99% usage so it might be it?)

Need to post your error here to get a better understanding


ARXML: consider the choices for the initial signal value

also, handle the value scaling correctly.
Andreas Lauser<EMAIL_ADDRESS>on behalf of MBition GmbH.
Provider Information

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

15 of 16 (93.75%)  changed or added relevant lines in 2 files are covered.
5 unchanged lines in 3 files lost coverage.
Overall coverage increased (+3.4%) to 96.362%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

cantools/database/can/formats/arxml.py
9
10
90.0%

Files with Coverage Reduction
New Missed Lines
%

cantools/logreader.py
1
97.17%

cantools/subparsers/monitor.py
2
84.16%

cantools/subparsers/plot.py
2
97.58%

Totals

Change from base Build<PHONE_NUMBER>:
3.4%

Covered Lines:
5563

Relevant Lines:
5773

💛  - Coveralls


Inner URLs with redirects needs to be corrected to the right URLs

Context: https://prisma-company.slack.com/archives/C5Z9TH6N9/p1640209857223700

Related: https://github.com/prisma/docs/pull/2652


Mention/notify users

For Feature Requests
Desired Feature:
Mention users by using "@". e.g. @username
Similar to how it is done here in github.
Allow to use it on pages and in comments.
Notify mentioned user by email.

+1

+1

+1

+1

Has there been any movement or decision on this?  I would very much like to see this feature.

@abossert Not as of yet.
If people could use the thumbs-up emoji on the original post instead of the +1 comments it would give the maintainers a much better idea of support for an issue like this.

+1 :) whenI craete page I would like to inform somehow for whom the page was created.

+1

(Y)

Hi, has there been any update on this feature @ssddanbrown?

+1

+2

Just :+1: 'd it as well. This may be a blocker for my group, otherwise really enjoy the workflows so far. Pitting this versus Confluence and this is a major feature difference (IMO).

Also interested if this will get featured or not

@ssddanbrown Any idea if this feature will be build into bookstack? The owner and/or the creator of a page would like to receive e-mail notifications whenever a comment is posted.

+1

For the moment I use the webhook system to notify users of a new comment, I use n8n for the processing workflow.
It's ok for a basic use, but I'm missing some information in the json about the comments, like if it's a reply to another user a key/value "replied_to: user_id" would be welcome.
Because in this case, it's always the creator of the page who will receive the notification and not the person to whom the answer is intended.
It would be very welcome to have an internal notification system in bookstack.

Is there any movement on this request?

This seems to be still on the roadmap. Dan mentioned this in the December video and said that the WYSIWYG editor for the comment system (which is now available) is a prerequisite to implement it

+1 for user mentions

@lommes I do not think it native active in core app. Do we need to try some hack here?


No output generated

I have installed the package to my test project, ran dotnet test /p:CollectCoverage=true as well as dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover, but no code coverage report was generated.
dotnet SDK: 1.0.4
Taregt Framework: netcoreapp1.1
xunit: 2.3.1
coverlet.msbuild: 1.0.0

@Structed pls target netcoreapp2.0 and let me know if you still don't see an output

@tonerdo Hey :) I have the same problem targeting netcoreapp2.0.

What's the output of dotnet --info?

Also, what test framework are you using?

I also tried the latest stable version of the .net core sdk.
I used xunit and mstest. same result with both of these.
.NET Command Line Tools (2.1.300-preview1-008174)
Runtime Environment:
OS Name:     Windows
OS Version:  10.0.16299
OS Platform: Windows
RID:         win10-x64

So my only thought is Coverlet is unable to find a suitable assembly to instrument.
Couple of questions:
What's the structure of your solution?
Are your tests in the same project with the classes you're testing?
Does the assembly you're trying to get coverage for have a PDB?

Hi, I have similar problem, but I get error in output:
Calculating coverage result...
C:\Users\username.nuget\packages\coverlet.msbuild\1.0.0\build\netstandard2.0\coverlet.msbuild.targets(19,5): error : Could not find file 'C:\Users\username\AppData\Local\Temp\ProjectName.Common_6c1a88f4-0f61-4510-827b-a26cc32ae3a4'. [C:\Users\username\Projects\ProjectName\ProjectName\src\Tests\ProjectName.GatewayCommon.UnitTests\ProjectName.GatewayCommon.UnitTests.csproj]
But file exists with extension .dll:
C:\Users\username\AppData\Local\Temp\ProjectName.Common_6c1a88f4-0f61-4510-827b-a26cc32ae3a4.dll
Can you advice?

If you want to check on failing project: https://github.com/mihasic/LuceneSearch/tree/coverlet

Hi, I am having the same problem as @lukasz-ciura-neyber
Using dotnet 2.1.203

Try a out the new NuGet package and let me know how it goes https://www.nuget.org/packages/coverlet.msbuild/1.0.1

works for me, thank you

With version 1.0.1 I get another error

@jeankedotcom I think that happens when calculating the summary result. The coverage results file should still have been generated

@tonerdo you are right, the coverage file exists.
But if the "dotnet test" command fails it will break my CI build on GitLab. Can I disable the summary report?

Hmmm... there's currently no way to disable summary, I should probably add that option. Is there a way for you to ignore that error?

I will check if I can ignore the error.
Or maybe you could check for totalLines to be 0 in line 35 of CoverageSummary.cs.
Something like this?
result.Add(System.IO.Path.GetFileNameWithoutExtension(mod.Key), totalLines == 0 ? totalLines : (linesCovered * 100) / totalLines);

@jeankedotcom new NuGet release which should completely fix this isse: https://www.nuget.org/packages/coverlet.msbuild/1.0.2. Feel free to reopen if any more errors show up


trying to port a character

Describe your bug here. Mind you, if you are modding, please try testing your bug in a clean version of the engine instead, this ensures the bug is actually caused by the engine itself. Also, if you're using an older version of JSE, please try the latest action build in the Actions tab or the latest release build. The issue has probably been fixed since that version. Oh yeah, and also be sure to check the pinned 'JS Engine: Known Issues' issue, to double check if your issue hasn't already been found!
im trying to port a character from another mod but it wont let me to
Command Prompt/Terminal/Crash logs (if existing)
flixel/graphics/title/FlxDrawQuadsltem.hx (Line 119)
flixel/FlxCamera.hx (Line 772)
flixel/FlxGame.hx (Line 873)
flixel/FlxGame.hx (Line 565)
openfl/events/EventDispatcher.hx (Line 426)
openfl/display/DisplayObject.hx (Line 1398)
Null Object Reference

Have you identified any steps to reproduce the bug? If so, please describe them below in as much detail as possible. Use images if possible.
1. Open JS Engine
2. Open Character Editor (i think the name is like that)
3. Open up the character that you ported
4. Done! An error!

Are you modding a build from source or with Lua?
Source
What is your build target?
Windows
Did you edit anything in this build? If so, mention or summarize your changes.
no, im not even modding
If you use 1.12.0 or earlier, did you have Optimized Chart Loading turned on?
None
Did you check for any similar issues to what you're reporting? Check, then come back here. If there is a similar issue, then do not report the issue, otherwise it will be marked as a duplicate.
Yes

your character graphic is missing or not in the right path, this is from flixel attempting to add an shader to an nonexistent/null graphic

i have the png xml and json on the right place and theyre not null

are you sure that you don't get a haxeflixel logo when doing that?

i do get it, i forgot to say one step, an haxeflixel logog pops up, click reload image.

you're pointing to a nonexistent character image file then


Update DraggableScrollableSheet docs to reflect API change

Description
This PR intends to update DraggableScrollableSheet docs for Web and Desktop platforms. On these platforms, the vertical dragging gesture does not provide natural behavior similar to other desktop applications.
By adding a note before the sample code so users are aware that the sample code will not work as expected on Desktop and Web. Also, refer to the instructions if they still want to implement it on these platforms.
Related issue
Fixes https://github.com/flutter/flutter/issues/111372
Pre-launch Checklist

[x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
[x] I read the Tree Hygiene wiki page, which explains my responsibilities.
[x] I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
[x] I signed the CLA.
[x] I listed at least one issue that this PR fixes in the description above.
[x] I updated/added relevant documentation (doc comments with ///).
[ ] I added new tests to check the change I am making, or this PR is test-exempt.
[x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Hi @Piinks, could you please help to review this? :)

Thanks for your review, Kate

It does make me wonder if we should have drag handles built into the DraggableScrollableSheet, but that would likely entail a design discussion first. Can you file an issue if one does not already exist?

I've searched but haven't found any similar one. Do you mind if I bring this topic to Discord for further discussion? (Because I'm still a bit vague on how it should work if it's a built-in feature)

Would you like to add tests so we can get this in?

I added tests :)

I've searched but haven't found any similar one. Do you mind if I bring this topic to Discord for further discussion? (Because I'm still a bit vague on how it should work if it's a built-in feature)

I don't mind at all, you are welcome to take it to discord or a new issue. :) I think that could be a fun feature.
I found these issues that are sort of related, one of them may be closed by this PR since it adds docs on ScrollBehavior and drag devices. Take a look at these, and if they don't seem quite right, file a new one and we can go from there!

https://github.com/flutter/flutter/issues/101903
https://github.com/flutter/flutter/issues/91288
https://github.com/flutter/flutter/issues/81842


Catch Fatal errors - should fix #89

I'll rely on CI to verify whether this is consistent with everything else in uTest.
(I'm on the road, looking through old issues on a tablet)

Is this the same as #92?

Looks like it - I also forgot to come back and fix the patch when I was at a desktop - I'll do it in a sec. :P

Okay I take that back - the tests seem to fail on master too, so the build failure doesn't appear to be my fault. 😝

This should be resolved in 0.4.5.


Authentication does not work when users have the SoundCloud app installed.

Hi, I have confirmed that this method does not work when the app is installed. I think it's because they may have added some kind of deep linking on the auth URL, which kicks the user out to the app from the web view.... and then the app merely says, 'URL not recognized.' Any idea what to do with this? Have confirmed on 4.x - 6.x. Thanks!

I will be converting the auth process to a Chrome Custom Tab based launching system this afternoon/ evening after updating Retrofit in the repo. Hold tight!

Dope, thanks man!

Hey, so update on the issue. SoundCloud currently intercepts any Android Intent that doesn't set an explicit target package to handle the intent. As such, the http://soundcloud.com/connect url immediately jumps to the SoundCloud app if it is installed, because it filters all intents for urls containing m.soundcloud.com and soundcloud.com. The trick was to tell the login mechanism to use the browser to open the Intent. Unfortunately, the facebook auth flow has an extra step that redirects back from facebook to soundcloud.com/connect/via/facebook/returning. You could add another intent filter that captures that facebook URL and then launch the Intent again with the browser explicitly, but I'm not sure if that's the best way to deal with it yet.
After cleaning the code up a bit, I'll push what I've managed to get working. If you'd like to get it going ASAP, here's some code that will launch the auth flow:
private void launchAuthFlow(Context context, String clientId, String redirectUri) {
    String loginUrl = "https://www.soundcloud.com/connect?" +
        "client_id=" + clientId +
        "&redirect_uri=" + redirectUri +
        "&response_type=code" +
        "&scope=non-expiring" +
        "&display=popup" +
        "&state=asdf";

     Uri authUri = Uri.parse(loginUrl);

    Intent dummyIntent = new Intent(Uri.parse("http://www.example.com"));
    List<ResolveInfo> availableBrowsers = context.getPackageManager()
        .queryIntentActivities(dummyIntent, PackageManager.MATCH_DEFAULT_ONLY);

    String packageName = "com.android.browser"; // Probably installed

    if(availableBrowsers != null && availableBrowsers.size() > 0) {
        packageName = availableBrowsers.get(0).activityInfo.packageName;
        // Definitely installed if it was in the list
    }

    Intent loginIntent = new Intent(Intent.ACTION_VIEW);
    loginIntent.setPackage(packageName);
    loginIntent.setData(authUri);
    context.startActivity(loginIntent);
}

Let me know if you're still having trouble afterwards. I got login with manual credentials and with google plus both working after launching the authentication flow this way.

@sampurcell93
Another update. Please try building from master. There are a few breaking changes in the authentication strategy. You can use either a chrome custom tab or launch it in a standalone browser. If using the custom tab, you will want to handle redirects in onResume instead of onNewIntent.
The authentication with the browser is essentially the same as the current setup (meaning its much more simple), but the chrome tab has some advantages in loading times, and I will be working on adding customization support in a future update.
You also have the option to extend SoundCloudAuthenticator if you want to create your own authentication strategy. It provides a few convenient methods that help define the auth flow a bit.
The major difference is that the authenticator is now an instance based setup instead of static methods.
BrowserSoundCloudAuthenticator browserAuth = new BrowserSoundCloudAuthenticator("clientID", "redirectUri", this); // this references an Activity

browserAuth.launchAuthenticationFlow(); // Opens the browser

...

// wherever you are handling the filtered intent for your callback

Hashmap<String, String> fieldMap = SoundCloudAuthenticator.handleResponse(getIntent(), String redirectUri, String clientId, String clientSecret); // Still a static method
//may move to instance method later on

browserAuth.getAuthService().authorize(fieldMap).enqueue(new Callback<AuthenticationResponse>() {
                @Override
                public void onResponse(Call<AuthenticationResponse> call, Response<AuthenticationResponse> response) {
                    Log.i(TAG, "Response was: " + response.raw().toString());

                    AuthenticationResponse authResponse = response.body();

                    if(authResponse != null) {
                        Log.i(TAG, "Auth success:  " + authResponse.access_token);
                    }
                }

                @Override
                public void onFailure(Call<AuthenticationResponse> call, Throwable t) {
                    Log.e(TAG, "Auth failure: " + t.getMessage());
                }
            }

Thanks for all your hard work man, I'll take a look right now

Getting a java.lang.NoSuchMethodError: No static method getPackageName on android.support.customtabs.CustomTabsClient error... I am using master right out of the box after upgrading my environment to sdk 24... any ideas?

In the build.gradle, try:
compile(name:'soundcloud-web-api-android-1.0.0', ext:'aar') {
transitive = true
}

No, that gives me the same error :/. I can't upgrade my SDK at the moment because I don't have time to verify successful integration. Any other thoughts?

My working implementation's dependencies look like this:

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile 'com.android.support:appcompat-v7:24.0.0'

  compile 'com.android.support:customtabs:24.0.0'
  compile 'com.squareup.okhttp3:okhttp:3.3.1'
  compile 'com.squareup.retrofit2:retrofit:2.1.0'
  compile 'com.squareup.retrofit2:converter-gson:2.1.0'

  compile (name: 'soundcloud-web-api-android-1.1.0', ext: 'aar')
}

Ah, it looks like 24 is Android N? My device is running 6.x and my users are on 4.x -> 6.x... Does this require Android-N specific features?

You could try to compile an earlier version of the support library (compile 'com.android.support:appcompat-v7:23.+' and `compile 'com.android.support:customtabs:23.+'``), it doesn't require anything specific to N, but I felt it was prudent to update everything to the latest.

That's the weird part - trying to compile with 23.+ shows the error in this project at compile time... It really seems like v24 introduced the getPackageName method.

Hm, that's possible... if you can setup your dependencies how they were before (when you were getting the runtime error trying to use Chrome Tabs), you could use the browser based authentication until you're ready to support Android N in your application. The methods and classes used there reference things that should all be available in Android SDK 23.

I stand corrected, I used the tabs client to attempt to resolve the package name in the browser based auth.
Try this until you're ready to update to SDK 24:
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import com.jlubecki.soundcloud.webapi.android.auth.SoundCloudAuthenticator;
import java.util.Map;

public class TempBrowserSoundCloudAuthenticator extends SoundCloudAuthenticator {

  private final Activity context;

  public TempBrowserSoundCloudAuthenticator(String clientId, String redirectUri, Activity context) {
    super(clientId, redirectUri);

    this.context = context;
  }

  @Override public boolean prepareAuthenticationFlow() {
    // Launches synchronously in this implementation, no preparation needed.
    return true;
  }

  @Override public void launchAuthenticationFlow() {
    Uri authUri = Uri.parse(loginUrl());

    Intent loginIntent = new Intent(Intent.ACTION_VIEW);
    loginIntent.setPackage(getBrowserPackageName());
    loginIntent.setData(authUri);
    context.startActivity(loginIntent);
  }

  private String getBrowserPackageName() {
    Intent webIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.example.com"));

    PackageManager manager = context.getPackageManager();
    ResolveInfo info = manager.resolveActivity(webIntent, 0);

    if(info != null) {
      packageName = info.activityInfo.packageName;
    } else {
      packageName = "com.android.browser";
    }

    return packageName;
  }
}

Dude, thanks so much. Got it working again. Many thanks for the quick response time

No problem, glad I could help :)
The project structure is getting a bit of a facelift to include the sample project in future updates. Hopefully this will help with implementation. Thanks for informing me of any issues!

@sampurcell93
Just a heads up, the project is now distributed via jcenter.
Adding compile 'com.jlubecki.soundcloud:soundcloud-api:1.1.1' will include the library in your application. You can continue to build from the repo if you would like, but this should be much easier. Your project will have to support at least API 16 up to Android N for it to work properly though, so heads up on that. I've also included a sample application in the project if you have any trouble. It's not very polished, but the code works at least. Thanks again for all the input!

One more issue, line 68 of BrowserSoundCloudAuthenticator.java is throwing
'Fatal Exception: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://www.soundcloud.com/connect?client_id=534319e63a2d4bf32042177dbc5efffb&redirect_uri=anthem-callback://soundcloud/redirect&response_type=code&scope=non-expiring&display=popup&state=asdf pkg=android }` for some of my users.
I assume this has to do with a problem in getBrowserPackageName.... maybe some people don't have browsers installed? Or perhaps com.android.browser is not universal.

One more issue, line 68 of BrowserSoundCloudAuthenticator.java is throwing
Fatal Exception: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://www.soundcloud.com/connect?client_id=MYID&redirect_uri=CB&response_type=code&scope=non-expiring&display=popup&state=asdf pkg=android }

for some of my users.
I assume this has to do with a problem in getBrowserPackageName.... maybe some people don't have browsers installed? Or perhaps com.android.browser is not universal.

Looking at the [documentation for resolveActivity](https://developer.android.com/reference/android/content/pm/PackageManager.html#resolveActivity(android.content.Intent, int)) it may be that the resolveInfo is not null, but the activityInfo it provides isn't valid because the ResolveInfo contains an intent chooser and not an explicit package to launch the Intent. I will look into implementing a solution ASAP.

@sampurcell93
I've pushed some code changes. I reimplemented the method that resolves the browser package, so hopefully that helps. The changes won't be available on jcenter just yet so you will have to build from source. Hopefully we can work these bugs out!

So since the wrapper directory was removed, every time I try to build there error
A problem occurred evaluating root project 'soundcloud-web-api-android'.
> Could not find method android() for arguments [build_a5b4wauuuldn67h8300b6r2um$_run_closure1@52953789] on root project 'soundcloud-web-api-android'.

is popping up. Tried to make a new wrapper but no such luck. Any advice?

Also, not sure if the new code is in jcenter yet, which is why I am trying to build master still

A few things you can try:
Run gradle build in the main directory if you have a local gradle installation, cd into the soundcloud-api directory before running ./gradlew build, or open the project in Android studio and build there.

I've added the gradle wrapper to the main project directory again, please let me know if you still have issues building from source.

Got it to build - it was a problem with there being an android {} directive in the root project build.gradle. Just had to remove that and gradle build worked like a charm. Still getting a few of those ActivityNotFoundExceptions but their incidence has dropped by a significant amount (like 95%).

At this point, the only reason I can think is that the devices don't have default browsers (which is kind of weird to be honest), but I will work on implementing a fallback with WebView which won't have any external application dependencies (though I would think a browser would be a reasonable dependency to expect).
You'll want to avoid using it if possible, as it can open up some slight security vulnerabilities, but it should be available on all proper android devices. (Also, I will provide an option to disable javascript which should improve the security of the WebView based auth flow). Another thing, you can implement your own SoundCloudAuthenticator if you believe you have a workaround. The class should be exposed by the library. I think I'm going to build a fallback mechanism as well, so that you can try multiple authentication methods and run the first one that works.
Please keep providing feedback! I really appreciate it :)

please
why IntentInfo return null
what's problem here?

MainActivity.java.zip
this my MainActivity class and IntetInfo return null

@AsmaaHassen
You check the intent every time the activity calls onResume. The activity can be started by various intents and not all of them may contain extra info. You should probably be handling the authentication callback in onNewIntent instead. You should also post the raw code snippets here for future reference. You can do that by clicking the "<>" button while you edit comments.

yes
thank you very much

we are able to launch the browser intent and we are able to login to sound cloud using the browser
but the browser intent is not closing on successful login into sound Cloud so and every time we are  getting the intent null and
Intent intent = getIntent();
    String intentInfo = intent != null ? intent.getDataString() : "Null intent.";

    Log.i(TAG, "Lifecycle method onResume with intent info: " + intentInfo);
    Log.d("intentFilter","intent"+intent);

    if(intent != null && intent.getDataString() != null && intent.getDataString().contains(REDIRECT)) {
        HashMap<String, String> authMap = SoundCloudAuthenticator.handleResponse(intent, REDIRECT, CLIENT_ID, CLIENT_SECRET);

        SoundCloudAuthenticator.AuthService service = tabsAuthenticator.getAuthService(); // Method is final, varies only with clientId used to construct the authenticator
        service.authorize(authMap).enqueue(new Callback<AuthenticationResponse>() {
            @Override
            public void onResponse(Call<AuthenticationResponse> call, Response<AuthenticationResponse> response) {
                Log.i(TAG, "Response was: " + response.raw().toString());

                AuthenticationResponse authResponse = response.body();

                if(authResponse != null) {
                    Log.i(TAG, "Auth success -  " + authResponse.access_token);

                    SharedPreferences preferences = getSharedPreferences(PREFS_NAME, MODE_PRIVATE);
                    preferences.edit().putString(AUTH_TOKEN_KEY, authResponse.access_token).apply();

                    Intent intent = new Intent(MainActivity.this, PlayerActivity.class);
                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    startActivity(intent);
                }

            }

            @Override
            public void onFailure(Call<AuthenticationResponse> call, Throwable t) {
                Log.e(TAG, "Auth failure - " + t.getMessage());
            }
        });
    } else {
        Log.w(TAG, "Other new intent not handled.");
    }

this is the snippet we are using to get the intent and authenticate the user so we are calling this snippet in the onResume of the activity

@musriabhijit Please include your intent filter in your AndroidManifest.xml in addition to the redirect you are using.

@sampurcell93 It's been a while, but I pushed some work onto the branch bug/2-fix-auth. It added a WebView-based authentication strategy and reworked a bit for the browser version. If you want to pull that code and build it manually, you might be able to see if it's fixed any of the issues you've been having. I haven't tested it thoroughly so I'm holding off on pushing the changes to jcenter, but so far it's all been working pretty well on my end.

For reference:
Add this to your main build.gradle repositories closure:
maven {
  url 'http://oss.jfrog.org/artifactory/oss-snapshot-local'
}

And add this to your project's build.gradle dependencies closure:
compile 'com.jlubecki.soundcloud:soundcloud-api:1.2.0-SNAPSHOT'

if you want to have the latest builds of the project.