Question: Transaction execution listeners?

I'd like to fix #36801 before going forward as I implemented it as a customizer which make the problem more apparent.

Transaction execution listeners
**Affects:** 5.3.10

Please provide a method to register a listener to be notified when a transaction is created/committed/rolledback/finished.

Can you try using following phases:-
BEFORE_COMMIT – The event will be handled before the transaction commit.
AFTER_COMPLETION – The event will be handled when the transaction has completed regardless of success.
AFTER_ROLLBACK – The event will be handled when the transaction has rolled back.
AFTER_COMMIT – The event will be handled when the transaction gets committed successfully.

I'm introducing a dedicated `TransactionListener` contract, with such listeners to be registered on the transaction manager itself. There are before/afterBegin, before/afterCommit and before/afterRollback callbacks which are being triggered by the transaction manager whenever it operates on an actual transaction.

This is effectively a callback interface for stateless listening to transaction creation/completion steps in a transaction manager. It is primarily meant for observation and statistics, not for resource management purposes where stateful transaction synchronizations are still the way to go. In contrast to transaction synchronizations, the transaction listener contract is commonly supported for thread-bound transactions as well as reactive transactions, with a common registration facility in the new `ConfigurableTransactionManager` interface.

I've settled on the term "transaction execution listener" for it, also naming the contract `TransactionExecutionListener` which goes nicely with the provided `TransactionExecution` argument in the callback methods. A more general "transaction listener" term can be confused with `TransactionalApplicationListener` and `@TransactionalEventListener`.

@snicoll @wilkinsona I suppose Boot could automatically inject any `TransactionExecutionListener` beans in the context into a `PlatformTransactionManager` or `ReactiveTransactionManager` that it configures, along the following lines:

@Bean
public JdbcTransactionManager transactionManager(DataSource dataSource, Collection transactionExecutionListeners) {
 JdbcTransactionManager tm = new JdbcTransactionManager();
 tm.setDataSource(dataSource);
 tm.setTransactionExecutionListeners(transactionExecutionListeners);
 return tm;
}

Thanks for the suggestion, @jhoeller. I've opened URL Sorry for the noise of #31001 which I opened in the wrong tracker.

Add any TransactionExecutionListener beans to the auto-configured transaction manager
Suggestion from Juergen:


Question: Invariant: Native Module Cannot be Null (Expo)?

We have released an updated version that includes the above reflections. Thank you for your patience!

Invariant: Native Module Cannot be Null (Expo)
Hi there,

I am trying to use this lib for a ios build and when debugging in metro I get the "Native Module Cannot be Null" error (please see screenshot attached). It goes away when I comment the printing code so it is definitely coming from this, I have installed npm package and have listed the package "react-native-star-io10" in my package.json as well but no luck.

I have been trying to solve this for a while, would greatly appreciate any help :)

image

I don't think this can run in Expo. Our SDK requires platform-specific features; Bluetooth and BLE to name a few.
I don't think platform specific-code can run in Expo.

It should work with an Expo development client.
You probably won't even need a config plugin looking at the install instructions
Most likely just infoPlist/permission settings
It would require some testing of course. Maybe @mnm458 or others have a device and wouldn't mind trying it out?
If there are issues, please share with the Expo community via Discord.
This could be a nice addition to expo.

@kickbk @mnm458 I came across some use info in the React Native documentation.

From the Caveats section,
"Because you don't build any native code when using Expo to create a project, it's not possible to include custom native modules beyond the React Native APIs and components that are available in the Expo client app."

So until that changes from the React Native side, we will not be able to support the Expo client

I already created (with the help of the expo team) a fork that works with a custom expo client. I just need to find the time to clean it up and share.
It is highly likely that if you have a project that requires this library, you'd be ok with a custom Expo client. You'd be handling native via a config plugin.

Hey @kickbk I think I'm having the same issue, could you please share this fork?

I made a fork that contains some of these fixes, you can try them out by using:

"react-native-star-io10": " URL

In your package.json

I have posted a workaround that we think is relevant to this issue at Issue #90.
We would appreciate it if you could refer to this.

Have you found a solution to this problem?
We will close this issue once, but if the issue is still not resolved, please reopen it or post a new issue.

[REQUEST] Support `use_frameworks!`
`react-native-star-io10` currently does not support `use_frameworks!` which means it cannot work alongside many popular libraries, such as `react-native-firebase`. Flipper is another library that doesn't support `use_frameworks!` and trying to meddle with overrides in the podfile will ultimately fail if using Firebase storage or Firebase functions.
Could we have `react-native-star-io10` suuport `use_frameworks!` soon? Is it complicated to add support for it? If it's simply achievable some edits to the Podfile, please share instructions.

@bandit-ibayashi we created a repo with a minimal project that reproduces this build-time issue: URL

The readme in that repo is an excerpt from the build log with the errors.

For those looking for a working solution: URL
It probably needs to be updated to integrate the updates from URL but it'll work.
Some of the fixes we introduced in the fork are hardcoded and there's a need for matching your project's Kotlin version with the one used by the lib, hence the "kotlin" branch for lack of time adding it via a config plugin.
I'm not currently maintaining this fork since I don't use the library in my project.

@kickbk @marvinklein I'm afraid for not responding to this request for a long time.

Our React Native project uses native code, so we didn't consider Expo. But we noticed the official document that contained this sentence has been updated. So we are investigating this matter again, taking into account the hints we received from everyone.

We would like to thank everyone for their cooperation, and please wait a little longer to find out whether Expo will be possible or not, and if so, how we can respond.

We found to be able to support "use_frameworks" by modifying .podspec file.

**Method**
1. Download current react-native-star-io10 (`yarn install` , etc.)
2. Add the following code to the react-native-star-io10.podspec file located in the node_modules directory.
3. Build it.

**Modification**

Please add the following code the above `s.vendored_frameworks = 'ios/libs/StarIO10.xcframework'`.

 podspec
 if ENV['USE_FRAMEWORKS']
 header_search_path = [
 '$(SRCROOT)/../../node_modules/react/** $(SRCROOT)/../../node_modules/react-native/**'
 ]

 exclude_source_file_name = [
 'libs/StarIO10.xcframework/ios-arm64_x86_64-simulator/StarIO10.framework/Headers/*.h libs/StarIO10.xcframework/ios-arm64_x86_64-simulator/StarIO10.framework/PrivateHeaders/*.h'
 ]

 s.pod_target_xcconfig = {
 "HEADER_SEARCH_PATHS" => header_search_path.join(" "),
 "EXCLUDED_SOURCE_FILE_NAMES" => exclude_source_file_name.join(" ")
 }
 end


Question: POST to a new table returns a 404, but GET on the same table returns a 200?

I get the idea, although I don't think this would be respected in practice. Name collisions could also happen in homographs too.

---

Since I was working on bulding the OpenAPI spec, I noticed that it's quite difficult to work with the `Accept-Profile` header, since the response, filters and permissions may change when that header is present and the endpoint is the same. Separating it into a different endpoint instead of a header helps a lot in simplifying this. Of course, we shouldn't build our API around OpenAPI, but I think it's good to know that the issue is there.

POST to a new table returns a 404, but GET on the same table returns a 200
### Environment

* PostgreSQL version: Postgres 15.5 running on my local development machine on port 5432
* PostgREST version: PostgREST 12.0.2 running on my local machine from an unmodified docker image pulled from `postgrest/postgrest`
* Operating system: macos 12.6.1

### Description of issue
I added a table `ApiVersion` to my `pmg` schema through a database migration. My problem is that when I try to POST a record in Postman to `/ApiVersion`, I get a 404 with no error body. I have another request in Postman that is a GET `/ApiVersion` and I get a 200 on that route.

- I did try both sending the server a SIGUSR1 signal (multiple times), and completely restarting the server, with no success.
- I have tried posting as both a single record and an array containing the record with the same results.
- I have tried POSTing to other tables in other schemas and that works with no problems
- I am wondering if there is some kind of database permissions problem causing this - but I would expect in that case to return a 403 and an error body describing the problem - not a 404 with an empty error body.
- I checked and my user `db_admin` has both USAGE and CREATE privileges on the `pmg` schema
- I checked the table permissions relating to `db_admin` and got: `db_admin,pmg,ApiVersion,{db_admin=arwdDxt/db_admin} `
So, the `db_admin` role has been granted INSERT, SELECT, UPDATE, DELETE, TRUNCATE, REFERENCES, and TRIGGER privileges on the table.
- I also checked the sequence permissions for the sequence used in the table index: `db_admin,pmg,ApiVersion_id_seq,{db_admin=rwU/db_admin}`. So, the `db_admin` role has been granted SELECT, UPDATE, and USAGE privileges on the sequence.

#### Summary
I would expect to be able to insert records in the `pmg."ApiVersion"` table with a POST request, but I get a 404. I can do a GET on the table with a 200.

### Steps to Reproduce

#### Table Creation
I create the table using a Knex migration, but the equivalent SQL (supplied by TablePlus) is below:

CREATE SEQUENCE IF NOT EXISTS pmg."ApiVersion_id_seq";
CREATE TABLE "pmg"."ApiVersion" (
 "id" int4 NOT NULL DEFAULT nextval('pmg."ApiVersion_id_seq"'::regclass),
 "name" varchar NOT NULL,
 "activeDate" timestamptz NOT NULL DEFAULT CURRENT_TIMESTAMP,
 PRIMARY KEY ("id")
);

#### Populate the table
SET ROLE db_admin;
INSERT INTO pmg."ApiVersion" ("name") VALUES ('weird-wallaby-92');

#### GET request
curl --location ' URL \
--header 'Accept-Profile: pmg' \
--header 'Authorization: Bearer (token containing the db_admin role)

Result:

[
 {
 "id": 1,
 "name": "weird-wallaby-92",
 "activeDate": "2024-02-16T13:48:10.548943-07:00"
 }
]

#### POST request
curl --location ' URL \
--header 'Accept-Profile: pmg' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer (token containing the db_admin role)\
--data '[
 {
 "name": "weird-wallaby-93"
 }
]'

Result:
{}

Ah, for methods different than `GET` the header to access a different schema is `Content-Profile` instead of `Accept-Profile`. Does this work for you:

bash
curl --location ' URL
--header 'Content-Profile: pmg'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer (token containing the db_admin role)
--data '[
{
"name": "weird-wallaby-93"
}
]'

I should add that I went through all the reproduction steps above, but instead of using the `pmg` schema I used a different schema (one that I've been using for a little longer) and this problem did NOT manifest. So it seems to be something connected to the `pmg` schema. Could be a permissions issue, but I've checked everything I can think of permissions-wise. And I still believe if it's a permissions issue it should manifest as a 403 with an error body.

@laurenceisla YES! That fixed it. But the weird thing is the other POST requests I have in Postman against tables in a different schema ('industrial'), worked with the Accept-Profile header, which is quite strange. Thank you so much!

Two headers is always confusing, agree. We'll fix this on URL

Does this behavior described by @jbstewart can be explained by something else than the schema selection in the header? I'm facing the exact same problem while following the tutorial. After creating the *todos* tables and applying the dedicated privileges I have a **200 OK** with GET `/todos` but a **404 Not Found** with POST `/todos`. However if I restart the Docker container (I'm running `postgrest/postgrest:v12.0.3` by the way) the POST `/todos` is successful.

Use `Prefer: schema=x` as an alternative to Accept-Profile/Content-Profile
## Problem

Changing from `Accept-Profile` to `Content-Profile` depending on the HTTP request method can be confusing. See URL and URL

We don't really need the flexibility of saying insert into into `schema.users` but give me the results of `another_schema.users` on the same request. This can be achieved in theory with `Content-Profile` from `Accept-Profile`.

## Solution

Use `Prefer: schema=x` instead and apply it to all HTTP methods.

This would be great, and help clean up some Caddy Config code I've had to implement in order to abstract and "fix" this.

I've seen many end users struggle with this too and make the common mistake of using the wrong header.

That should be in its own issue but I'd be against it because:

- it makes the url brittle (a schema is an implementation detail and a rename would break the url)
- would make impossible to do resource embedding across different schemas (if we ever want to)
- will make custom urls harder to implement later on ( URL

@wolfgangwalther I've opened a new issue for the schema path idea: URL

I guess we can have both? I don't see why one would exclude the other. This issue is mostly about improving the current header way.

Now that we have `Prefer: handling=strict`, we can use `Prefer: handling=strict; schema=xx` instead. No need for creating a new header.

That doesn't look right according to REST definition of resource.

 URL

A schema is an implementation detail. The "concept" (say "authors") can move schemas and it'll still be the same. Having the schema on the path results in brittle URLs.

This way will also give us the flexibility of doing cross-schema resource embedding if the need arises. Using paths for schemas will overcomplicate the syntax `/schema1/projects?select=schema2/projects`?

---

Besides that `Prefer` is just an improvement over the existing Accept/Content-Profile headers so not a new feature. I don't see why not improve things.

It's the only header we can use without inventing an `X-Something`, which is much more likely to give trouble. If you have an alternative header, I'm all ears..

From a conceptual point of view (the REST one), those `items` you refer to should be different concepts. The correct db design for that is to have only one parent table `items` then use table inheritance for childs `items_x` and `items_y`. Those would be different endpoints then.

IMO at the relation level. Databases and schemas are boxes of relations. If you rename the table/view then it is a different relation thus a different concept.

Hm, I don't see why. IME besides the different headers that has been working just fine. Simple in interface, implementation and maintenance.

---

We had another discussion about the `Host` header pointing to different databases. Following your URL argument here, should we now use `/db/schema/table`? (Like prest does?) Typing that.. looks inconvenient for users.

Maybe that's the real win we have with the header approach. We're able to provide default schemas/databases for our endpoints and keep them simpler.

OpenAPI is a valid point. So in general is harder to provide a static spec with the header approach.

In that case I guess we should also ditch the `Host` idea for mapping an endpoint to another database relation.

Let's move forward with the schema in URL then. Will open a new issue for that.


Question: Help with installing on macOS Ventura 13?

Great - glad this all worked :)! Can you confirm that you have OpenMP support, i.e., that you can use multiple threads now?

Sidenote: The reason why you were facing the compilation and non-detection of `llvm-clang/python/numpy` is all because you (or `homebrew`) have the relevant aliases set. The aliases work fine for you since you are always accessing from an interactive terminal - i.e., a terminal where you can send keyboard input to. The shell sessions spawned by `common.mk` are non-interactive and, therefore, **do not** know about the aliases.

I also suspect your `PATH` variable does not contain `/opt/homebrew/bin` (for `llvm-clang`) ahead of `/usr/bin` (for `apple-clang`), and thus, when the non-interactive shell resolves `clang` as `/usr/bin/clang`. Since I don't use `homebrew`, I am unsure if it is an intentional design that `/opt/homebrew/bin` is not added to your `PATH` environment variable. If you ever run into such odd issues of not-detecting-the-correct-tool, then it might be worthwhile adding the full path to whichever tool that you are wanting to detect (or equivalently, add `/opt/homebrew/bin` to `PATH` either in the terminal you are working in, or in the startup shell file - `.bashrc/.zshrc` etc)

Help with installing on macOS Ventura 13
Hi,

I am trying to help a student install Corrfunc on their MacBook, which has the latest OS (Ventura 13, I believe). We tried Method 2 (i.e., directly using pip), but ran into the `failed building wheel for Corrfunc` error. Then we tried Method 1, but unfortunately got the following error after running `make CC=gcc-13`:

In file included from ../../utils/cpu_features.c:13:

In function 'cpuid',

 inlined from 'runtime_instrset_detect' at ../../utils/cpu_features.c:27:5:

../../utils/cpu_features.h:41:4: error: impossible constraint in 'asm'

 41 | __asm("cpuid" : "=a"(a),"=b"(b),"=c"(c),"=d"(d) : "a"(functionnumber),"c"(0) );

 | ^~~~~

In function 'cpuid',

 inlined from 'runtime_instrset_detect' at ../../utils/cpu_features.c:29:5,

 inlined from 'runtime_instrset_detect' at ../../utils/cpu_features.c:19:5:

../../utils/cpu_features.h:41:4: error: impossible constraint in 'asm'

 41 | __asm("cpuid" : "=a"(a),"=b"(b),"=c"(c),"=d"(d) : "a"(functionnumber),"c"(0) );

 | ^~~~~

In function 'xgetbv',

 inlined from 'runtime_instrset_detect' at ../../utils/cpu_features.c:54:10,

 inlined from 'runtime_instrset_detect' at ../../utils/cpu_features.c:19:5:

../../utils/cpu_features.h:69:4: error: impossible constraint in 'asm'

 69 | __asm("xgetbv" : "=a"(a),"=d"(d) : "c"(ctr) : );

 | ^~~~~

In function 'cpuid',

 inlined from 'runtime_instrset_detect' at ../../utils/cpu_features.c:58:5,

 inlined from 'runtime_instrset_detect' at ../../utils/cpu_features.c:19:5:

../../utils/cpu_features.h:41:4: error: impossible constraint in 'asm'

 41 | __asm("cpuid" : "=a"(a),"=b"(b),"=c"(c),"=d"(d) : "a"(functionnumber),"c"(0) );

 | ^~~~~

In function 'cpuid',

 inlined from 'runtime_instrset_detect' at ../../utils/cpu_features.c:62:5,

 inlined from 'runtime_instrset_detect' at ../../utils/cpu_features.c:19:5:

../../utils/cpu_features.h:41:4: error: impossible constraint in 'asm'

 41 | __asm("cpuid" : "=a"(a),"=b"(b),"=c"(c),"=d"(d) : "a"(functionnumber),"c"(0) );

 | ^~~~~

make[2]: *** [../../utils/cpu_features.o] Error 1

make[1]: *** [DD] Error 2

make: *** [theory] Error 2

Do you know what could be going wrong and what else we can try?

@boryanah Thanks for reporting this! Yeah, this is a known issue and we are working towards a fix. In the meantime, please follow the comments/steps in #294 - hopefully that will at least let you compile.

Thanks a lot! We managed to install it following the instructions in that thread.

Ohh great - glad at least you could use the workaround and get Corrfunc running. I am closing this issue but please feel free to reopen if you need additional help.

M2 compiling issues
## General information

- Corrfunc version: 2.5.0
- platform: M2 Mac, macOS Monterrey
- installation method (pip/source/other?): pip, then git clone

## Issue description
pip:
ERROR: Failed building wheel for Corrfunc
 Running setup.py clean for Corrfunc
Failed to build Corrfunc
ERROR: Could not build wheels for Corrfunc, which is required to install pyproject.toml-based projects

GitHub directory results in the following error after "make install":
clang: error: the clang compiler does not support '-march=native'

### What have you tried so far?
Changing the "-march=native" lines in common.mk to "-mpu-apple=a14", adding make CC=gcc, updating my gsl/gcc/python/pip packages - still I get the same error.

## Minimal failing example
** could not install

terminal
make install

# issue

Makefile:9: Not compiling C extensions for mocks. Either python or numpy not available
gcc -DVERSION=\"2.5.0\" -DUSE_UNICODE -std=c99 -m64 -g -Wsign-compare -Wall -Wextra -Wshadow -Wunused -fPIC -D_POSIX_SOURCE=200809L -D_GNU_SOURCE -D_DARWIN_C_SOURCE -O3 -funroll-loops -march=native -fno-strict-aliasing -Wformat=2 -Wpacked -Wnested-externs -Wpointer-arith -Wredundant-decls -Wfloat-equal -Wcast-qual -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wno-unused-local-typedefs logbins.c -lm -o logbins
clang: error: the clang compiler does not support '-march=native'
make[1]: *** [logbins] Error 1
make: *** [install] Error 2

Thanks for using Corrfunc *and* for reporting the issue. I have been meaning to add the compilation-on-m1/m2 fix from the `arm64` branch into the `master` branch and this gives me the reminder to do so now.

Even after the compilation is fixed, you still will have another issue with the non-detection of python/numpy. Can you add a bit more detail about your python/numpy setup - are you using conda/macports/brew?

@quasars100 Will you please do the following to check if the new commits fix your compilation issue? The steps would be:

 1. git clone
 2. git checkout -b fix-compile-on-apple-soc
 3. make clean
 4. make

This should compile all of the command-line executables. If you encounter any warning/errors, please report back.

Thank you so much for the quick reply. My python version is Python 3.10.12 (installed using brew) and NumPy version is 1.24.3 (installed using pip). Local environment (no virtualenv), terminal, packages installed using brew (no condo/macports).

I tried running the code block above and unfortunately got the following error:

In file included from ../../utils/cpu_features.c:13:
../../utils/cpu_features.h:41:10: error: couldn't allocate output register for constraint 'a'
 __asm("cpuid" : "=a"(a),"=b"(b),"=c"(c),"=d"(d) : "a"(functionnumber),"c"(0) );
 ^
../../utils/cpu_features.h:41:10: error: couldn't allocate output register for constraint 'a'
../../utils/cpu_features.h:69:10: error: couldn't allocate output register for constraint 'a'
 __asm("xgetbv" : "=a"(a),"=d"(d) : "c"(ctr) : );
 ^
../../utils/cpu_features.h:41:10: error: couldn't allocate output register for constraint 'a'
 __asm("cpuid" : "=a"(a),"=b"(b),"=c"(c),"=d"(d) : "a"(functionnumber),"c"(0) );
 ^
../../utils/cpu_features.h:41:10: error: couldn't allocate output register for constraint 'a'
5 errors generated.
make[2]: *** [../../utils/cpu_features.o] Error 1
make[1]: *** [DD] Error 2
make: *** [theory] Error 2

That is odd - those lines of code should never be seen by the compiler *if* the environment variable `__ARM_NEON` is defined - which is supposed to be the case. For reference, I just did a fresh repo clone and tried out my instructions and those worked. I also notice that there is line number mis-match between what I see and what you have reported in the error - is it possible that you accidentally skipped the checkout branch line? There was an error in what I quoted - you should do `git checkout fix-compile-on-apple-soc` (i.e., without the `-b` )

If you were indeed in the correct branch, will you please report back on the following steps:

- please copy-paste the output generated during the (unsuccessful) compilation process. Should look something like this:

clang -DOUTPUT_RPAVG -DENABLE_MIN_SEP_OPT -DCOPY_PARTICLES -DLINK_IN_DEC -DLINK_IN_RA -DDOUBLE_PREC -DUSE_OMP -DVERSION=\"2.5.0\" -DUSE_UNICODE -std=c99 -m64 -g -Wsign-compare -Wall -Wextra -Wshadow -Wunused -fPIC -D_POSIX_SOURCE=200809L -D_GNU_SOURCE -D_DARWIN_C_SOURCE -O3 -fopenmp=libomp -funroll-loops -fno-strict-aliasing -Wformat=2 -Wpacked -Wnested-externs -Wpointer-arith -Wredundant-decls -Wfloat-equal -Wcast-qual -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wno-unused-local-typedefs -I../../io -I../../utils -I/opt/local/include -I../../mocks/DDrppi_mocks -I../../mocks/DDsmu_mocks -I../../mocks/DDtheta_mocks -I../../mocks/vpf_mocks -c run_correlations_mocks.c -o run_correlations_mocks.o

And then, can you please report back on these two things at the command-line:
- `which ` (where you replace the with whichever compiler that you are using).
- ` -mcpu=apple-m1 -dM -E - < /dev/null | grep -i ARM`

Here is what the output is after the following steps.
In terminal, in the ~/Corrfunc directory:

 _(1. git clone ) --> already cloned and in the Corrfunc directory_
 2. git checkout fix-compile-on-apple-soc
 3. make clean
 4. make

Output (in terminal):

In file included from ../../utils/cpu_features.c:13:
../../utils/cpu_features.h:41:10: error: couldn't allocate output register for constraint 'a'
 __asm("cpuid" : "=a"(a),"=b"(b),"=c"(c),"=d"(d) : "a"(functionnumber),"c"(0) );
 ^
../../utils/cpu_features.h:41:10: error: couldn't allocate output register for constraint 'a'
../../utils/cpu_features.h:69:10: error: couldn't allocate output register for constraint 'a'
 __asm("xgetbv" : "=a"(a),"=d"(d) : "c"(ctr) : );
 ^
../../utils/cpu_features.h:41:10: error: couldn't allocate output register for constraint 'a'
 __asm("cpuid" : "=a"(a),"=b"(b),"=c"(c),"=d"(d) : "a"(functionnumber),"c"(0) );
 ^
../../utils/cpu_features.h:41:10: error: couldn't allocate output register for constraint 'a'
5 errors generated.
make[2]: *** [../../utils/cpu_features.o] Error 1
make[1]: *** [DD] Error 2
make: *** [theory] Error 2
achen@MAC0008879 Corrfunc %

Just to confirm: there are *no* matches to the ARM grep command for either of the compilers?

Also, what happens if you do make CC=gcc (after a make clean)

What’s happening is that the compiler is not supposed to see that chunk of code on ARM, based on a variable usually defined by the compiler. That assumption of defined variable seems to break down on your setup. Since I don’t use brew (macports person) here, I hadn’t encountered this issue before

Since @quasars100 probably ran the original instructions with `git checkout -b fix-compile-on-apple-soc`, they probably have a local branch that's not tracking the remote. I think the steps to fix this are:

$ git checkout master
$ git branch -d fix-compile-on-apple-soc
$ git checkout fix-compile-on-apple-soc

I think at that point, you'll have a local branch that's tracking the remote, which you can confirm with `git branch -vv` or `git status`. Then hopefully the code will compile.

However, when I check my python version, it was 3.10, which is > python2.7

achen@MAC0008879 Corrfunc % which python
python: aliased to /opt/homebrew/bin/python3.10

And numpy:

Python 3.10.12 (main, Jun 7 2023, 00:37:42) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

'1.24.3'

which is >numpy 1.7.

Sorry for how long this issue seems to be, and thank you all again for all your help.

Thank you, and after running these steps, the code did seem to compile, however, this was the end output:

Makefile:7: Not compiling C extensions for mocks. Either python or numpy not available
/Library/Developer/CommandLineTools/usr/bin/make -C DDrppi_mocks
make[2]: Nothing to be done for `all'.
/Library/Developer/CommandLineTools/usr/bin/make -C DDtheta_mocks
make[2]: Nothing to be done for `all'.
/Library/Developer/CommandLineTools/usr/bin/make -C DDsmu_mocks
make[2]: Nothing to be done for `all'.
/Library/Developer/CommandLineTools/usr/bin/make -C vpf_mocks
make[2]: Nothing to be done for `all'.
for dir in DDrppi_mocks DDtheta_mocks DDsmu_mocks vpf_mocks examples; do \
 /Library/Developer/CommandLineTools/usr/bin/make -C $dir lib; \
 done
make[2]: Nothing to be done for `lib'.
make[2]: Nothing to be done for `lib'.
make[2]: Nothing to be done for `lib'.
make[2]: Nothing to be done for `lib'.
make[2]: Nothing to be done for `lib'.
/Library/Developer/CommandLineTools/usr/bin/make -C examples
make[2]: Nothing to be done for `all'.
achen@MAC0008879 Corrfunc %

Also, when I try calling "Corrfunc" in python and using its commands, I get the following error:

Traceback (most recent call last):
 File "/Users/achen/Corrfunc/Corrfunc/theory/xi.py", line 187, in xi
 from Corrfunc._countpairs import countpairs_xi as xi_extn
ModuleNotFoundError: No module named 'Corrfunc._countpairs'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File " ", line 1, in
 File "/Users/achen/Corrfunc/Corrfunc/theory/xi.py", line 191, in xi
 raise ImportError(msg)
ImportError: Could not import the C extension for the correlation function.

The package does import in python without issue, it's just when I try running the commands they don't work.
Thanks again, and sorry for the myriad of issues this seems to have on brew.

Hoorrray - that's definitely progress! At least the code seems to be compiling (which I am surprised by, given the lack of the (usually) defined `ARM` variables but I will put that down to a bad `grep` implementation).
@quasars100 Please don't apologize - you are helping us improve Corrfunc, and that, in turn, helps everyone - so thank you!

@lgarrison Not really sure why `python` is not being detected - the detection is simply a shell calling `python`! I see that the output says ` /bin/sh: python: command not found`. My guess is that `python` is defined as an **alias** and, therefore, only available on the interactive terminal (i.e., where @quasars100 is working but not through the non-interactive terminal invoked by `make`).
@quasars100 What do you get if you try `alias python`? And regardless of the alias status, using `python -m pip install -e . --verbose` should work. Even if `python` is aliased, that specific command should use the correct python.

Related, I see that OpenMP is not enabled; ideally, that also needs to be fixed. @quasars100 Will you please run `brew install llvm` to install the OpenMP-enabled version of `clang` and then recompile (after `make clean`) by invoking `make` (or equivalently, `make CC=clang`)

@quasars100 To explicitly clarify, as long as `python` and `numpy` is not detected at compile time, the Corrfunc C extensions will **not** be compiled, and therefore, you will not be able to use Corrfunc from python

Here is what I get when running "alias python" in terminal:

alias python
python=/opt/homebrew/bin/python3.10

(which python
python: aliased to /opt/homebrew/bin/python3.10 )

So prior to opening this issue, I actually ran "brew install llvm", and that is the version of clang my current clang compiler is aliased to, which is why the warning of "OpenMP is not available with apple clang" was confusing, since clang should be aliased away from Apple clang now.

After running "make CC=clang", OpenMP is enabled, but I still get this error:

/bin/sh: python: command not found
/bin/sh: python: command not found
/bin/sh: line 0: [: too many arguments
/bin/sh: line 0: [: too many arguments
../common.mk:497: Found python version .. but minimum required python is 2.7
../common.mk:502: Found NUMPY version .. but minimum required numpy is 1.7

However when I check the python version:

which python
python: aliased to /opt/homebrew/bin/python3.10
achen@MAC0008879 Corrfunc % python
Python 3.10.12 (main, Jun 7 2023, 00:37:42) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

'1.24.3'

Python > 2.7 and numpy > 1.7. Do you know if this is something to be changed in "common.mk" or my local environment?

Thank you again so much for all your help!

Ohh good - so python *is* defined as an alias. No wonder `make` can't find python.

Try and run `export CC=clang && python -m pip install -e .` - that should do the trick

Yes, that worked! (Has to be in the Corrfunc cloned directory though).
Thank you so much!


Question: Not downloading raindrop data after 3000 and crashes?

Despite what the documentation says, it looks like there isn't a `X-RateLimit-Reset` header (or any of the other headers) when there's a 429. Instead you get a `Retry-After`.

Not downloading raindrop data after 3000 and crashes
This is the error shows after the crash. I only paste Test API key from raindrop

OS: MacOS
Installation: Brew

Thanks @aoksan. I've been anticipating this but haven't been in a position to create it for myself. It's pretty much what #22 has in mind, to some degree.

Long story short: the code that uses the API to download the raindrop data is far too straightforward at the moment, and will need some backoff handling adding.

Now that I know there's someone seeing this sort of thing I'll try and make addressing this a priority (until now I've been concentrating more on the UI side of things; the API side of things needs some attention).

@davep I’d be happy to test the code before the release! Let me know when you have the test version ready, and I’ll give it a try when I free.

Awesome, thanks. Depending on what works best for you you'll find the update in this PR or the `throttle-download` branch.

The script is worked. First downloaded up to 2975 bookmarks, paused to wait for Raindrop, and then resumed downloading. A total of 4200 bookmarks were downloaded.

Excellent! Thanks for testing that. Hopefully tomorrow then I'll roll out a proper release.

Consider making the full download a little less aggressive
Right now the full download of all Raindrop data goes pretty hard. So far raindrop.io isn't complaining, and also it shouldn't happen too often if you're mostly using the Braindrop itself[^1].

Look at ensuring that the download code observes any throttling, and perhaps also provide a method of interrupting a download.

[^1]: Little less the case if you're a Pro user as Raindrop will do broken link scanning, etc, which will cause changes on the server that will trigger a fresh download the next time you run up the application.

Note the rate limits for the Raindrop API: URL

It does say:

which would suggest that Raindrop wouldn't be subject to this because it's not using OAuth; but I suspect this is awkward wording and the same limits apply to calls using the test token too.

It's also worth noting that 120 requests per minute, given the scenario written about in #72, would mean it would take at least 30 seconds to download those 3,000 raindrops. It might be worth looking at estimating the number of pages that need downloading, calculating any pause that needs to be used based on that, and also letting the user know how long they can expect to wait (ish -- there's also the issue of download speed and stuff, of course).

It might make more sense to work around these headers:

X-RateLimit-Limit
X-RateLimit-Remaining
X-RateLimit-Reset


Question: Adding Jupyter Notebook causes disconnect from remote server?

We figured out it was caused by Pylance extension killing the remote extension host process (see details in URL The Pylance team has fixed this issue in Prerelease and it working on a recovery release for stable. To mitigate/workaround this issue before the fix lands:

* Open an empty Remote SSH window (Remote indicator -> Connect to Host ... -> Pick the remote)
* Downgrade the Pylance extension to previous version (a week ago) or disable it for now

We will keep you posted once there is a new Pylance release.

Adding Jupyter Notebook causes disconnect from remote server
Type: Bug

When ssh-ed into a node, I can run files & use the terminal normally.

However, when I add a new jupyter notebook, it shows the "setting up ssh..." notification, then disconnects from the server.

This does not happen when I add a new text file or python file, so maybe an extension.

VS Code version: Code 1.83.1 (f1b07bd25dfad64b0167beb15359ae573aecd2cc, 2023-10-10T23:48:05.904Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Connection to 'SSH: 209.137.198.14' could not be established Canceled
Connection to 'SSH: 209.137.198.14' could not be established Canceled

 System Info

|Item|Value|
|---|---|
|CPUs|11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 x 2803)|
|GPU Status|2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled|
|Load (avg)|undefined|
|Memory (System)|15.77GB (2.81GB free)|
|Process Argv|--crash-reporter-id 85b6318c-39aa-4637-93f5-fc2aac3f163d|
|Screen Reader|no|
|VM|0%|

Connection to 'SSH: 209.137.198.14' could not be established Canceled

Connection to 'SSH: 209.137.198.14' could not be established Canceled
 Extensions: none
 A/B Experiments

vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
py29gd2263:30856252
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
2e4cg342:30602488
f6dab269:30613381
showlangstatbar:30737416
962ge761:30841074
03d35959:30757346
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
gsofa:30866041
pythonnosmt12:30797651
pythonidxpt:30866567
pythonnoceb:30805159
copilotsettingc:30859502
asynctok:30821568
dsvsc013:30795093
dsvsc014:30804076
diffeditorv2:30821572
dsvsc015:30845448
pythontestfixt:30866405
pyreplss1:30865275
pythoncet0:30866520
h48ei257:30867296
pythontbext0:30864172

I'm having this exact same issue, also when ssh-ed in. I can also execute the notebook through code - it's only when it's brought up on the VSCode UI that the disconnect occurs.

This is a duplicate of URL and we are working on a fix now. Let's track this in URL thank you!

Remote SSH Connection Crashed after openning a Jupyter Notebook on the remote server
Does this issue occur when all extensions are disabled?: No

- VS Code Version: 1.83.1
- OS Version: Windows 11 latest

Steps to Reproduce:

1. Open up a remote ssh connection to a remote server
2. Open a Jupyter Notebook stored on that remote server. It can be a brand new Notebook or something already existed.
3. VSCode crashed with "Cannot reconnect. Please reload the window."

It could be a problem with VSCode, or the Python / Jupyter extension. This did not happen with VSCode 1.83.0 so something in the update could have messed things up.

Same issue here. I've found that some workspaces (such as selecting the parent directory) appears to avoid the issue. The "Cannot reconnect. Please reload the window." error only occurs when you actually select a kernel. I don't have any .vscode configuration in either of these workspaces, so I'm not really sure what the issue is.

After downgrading to VSCode 1.83.0, I'm still facing the same issue

You need to first remove the .vscode_server folder on the remote server, then reinstall vscode on your local computer with the older version, and then reinstall the extensions on remote server (Python, Jupyter, etc.). The problems go away after I did these steps

I'm seeing the same problem when connecting to Remote-SSH as well as WSL. occurs in both "code" and "code-insiders" (from MS App Store). Specifically occurs for me when attempting to "Select Kernel".

I just encountered the same issue. When I was selecting the Jupyter kernel, the SSH connection began to disconnect. At the same time, I noticed through the 'htop' command in the terminal that the CPU usage began to spike significantly as the SSH connection was interrupted.

I have the same problem since yesterday. I can work on other files via vscode ssh connection. However, when I open any Jupyter notebook, it asks for the password again and the connection times out.

Same issue here, specifically when saving-as a new notebook created with the "Create: New Jupyter Notebook" shortcut. Breaks my connection to WSL in every open window. Only quick fix I've found is to restart VSCode entirely

Have the same problem, but neither reloading, nor reinstall made any impact.

Discovered the solution that worked for me (**local**: macOS Ventura 13.6, M1, **remote server**: Ubuntu 22.04.3 LTS x86_64).

1. Backup `settings.json` (if you've made any local configurations).
2. Close VS Code locally and remotely.
3. Completely delete VS Code from your local machine via steps in #42603103.
4. Deleted VS Code server from your remote server via:
- `sudo apt purge code` (deleted VS Code from your remote server)
- `rm -rf .vscode-server` (delete VS Code server folder from your `$HOME` directory)
- `sudo apt autoremove` (delete everything that have not been previously deleted including all dependencies of VS code)
!!**NOTE**!! use this command carefully as it will erase all dependencies that have not been deleted previously from your system.
- _`rm -rf .ipython`_ (perhaps this command is not required, but I executed it in the pipeline)
5. Download version of July 2023 (version 1.81) on your local machine.
6. !!**Disable**!! as VS code make autoupdates in background #50162685.
7. Configure clean VS code as new one (copy `settings.json`, install required extensions, etc.)
8. Establish remote connection with your remote server via ssh from VS Code toolkit.
9. Install all extensions that are required on your remote server.

Again, this solution worked for me, but I cannot assure that it will work for all mac users.

Yep, similar to my solution on windows or linux above. The important thing is to delete the .vscode_server folder from remote and uninstall local 1.83.1 vscode, then downgrade to 1.83.0 and reinstall everything on remote. It sucked because I have to use about 10 remote servers daily.

This is also happening on version 1.82.2 on a remote connection to a Ubuntu 22.04 host.

- Open ipynb with extensions disabled -> fine
- Open ipynb with extensions enabled -> Crashes right after activating extensions, before even selecting kernel
- Have tried deleting all extensions and reinstalling them, worked shortly at one point but then started crashing again

My solution is downgrading the jupyter extention to v2023.10.1002931100 (but I dont know my last jupyter version, just downloaded the second version from vscode office website), that works for me.


Question: Weird notification if local jdk is specified?

You can also tryout following with docker & devcontainer and compare your local setup to figure out what's wrong.
 URL

Weird notification if local jdk is specified
Greetings,

When I'm tying to spec path to local jdk installation, everytime, when I autocomplete code, bunch of notifications pop up, like in screenshot below. Also listing configuration script, maybe there is some misconfiguration

lua
return {
 "nvim-java/nvim-java",
 config = false,
 dependencies = {
 {
 "neovim/nvim-lspconfig",
 opts = {
 servers = {
 jdtls = {
 settings = {
 java = {
 runtimes = {
 name = "JavaSE-21",
 path = "~/Library/Java/JavaVirtualMachines/corretto-21.0.5/Contents/Home",
 },
 },
 },
 },
 },
 setup = {
 jdtls = function()
 require("java").setup({
 jdk = {
 auto_install = false,
 },
 })
 end,
 },
 },
 },
 },
}

This looks like something unrlated to nvim-java but jdtls. You could try to find related issues in jdtls project.

The problem is:

 opts = {
 servers = {
 jdtls = {
 settings = {
 java = {
 runtimes = {
 name = "JavaSE-21",
 path = "~/Library/Java/JavaVirtualMachines/corretto-21.0.5/Contents/Home",
 },
 },
 },
 },
 },

Pass the jdtls table to nvim-java setup and delete opts = {...} altogether.

Duplicate of #293

I haven't been clear and maybe I have been partially wrong.
Let me clarify:
Passing opts to nvim-lspconfig causes it to setup jdtls before nvim-java. Remove it but take the jdtls part and pass it to jdtls setup after nvim-java has setup. Like that:

lua
 require('java').setup {
 -- Your custom jdtls settings goes here
 jdk = {
 auto_install = false
 },
 }

 require('lspconfig').jdtls.setup {
 -- Your custom nvim-java configuration goes here

 settings = {
 java = {
...

I'm not sure what you mean by following the documentation but some things are not obvious like the order in which plugins get setup depending on how you structure your configuration. Nvim-java is picky about that. It needs mason setup before it gets setup and also it needs to be setup before jdtls is setup.

For reference, take the URL starter project configuration.

Thanks
I understand my mistake : starting from kickstart.nvim, I created a custom/plugins/java.lua file because I did not want to modify the init.lua file.
With those .setup in the init.lua file everything is fine. I keep the java.lua file for keymaps but not setup.
Thanks again.

bug: No delegateCommandHandler for vscode.java.test.findTestTypesAndMethods
### Did you check docs and existing issues?

- [X] I have read all the plugin docs
- [X] I have searched the existing issues
- [X] I have searched the existing issues of plugins related to this issue

### Neovim version (nvim -v)

v0.10.1

### Operating system/version

MacOS 14.4.1

### Describe the bug

I have an installation of nvim-java as follows -

{
 "nvim-java/nvim-java",
 dependencies = {
 "neovim/nvim-lspconfig",
 'nvim-java/lua-async-await',
 'nvim-java/nvim-java-refactor',
 'nvim-java/nvim-java-core',
 'nvim-java/nvim-java-test',
 'nvim-java/nvim-java-dap',
 'MunifTanjim/nui.nvim',
 'neovim/nvim-lspconfig',
 'mfussenegger/nvim-dap',
 {
 'JavaHello/spring-boot.nvim',
 commit = '218c0c26c14d99feca778e4d13f5ec3e8b1b60f0',
 },
 {
 'williamboman/mason.nvim',
 opts = {
 registries = {
 'github:nvim-java/mason-registry',
 'github:mason-org/mason-registry',
 },
 },
 },
 opts = {
 servers = {
 jdtls = {
 settings = {
 java = {
 configuration = {
 runtimes = {
 {
 name = "JavaSE-17",
 path = "/opt/homebrew/opt/openjdk@17/bin/java",
 default = true
 },
 {
 name = "JavaSE-11",
 path = "/opt/homebrew/opt/openjdk@11/bin/java",
 }
 }
 }
 },
 },
 },
 },
 setup = {
 jdtls = function()
 require("java").setup()
 end,
 },
 },
 },

When i attempt to run ANY java method provided by the plugin, I get the following error:

 02:25:21 msg_show.lua_error JavaTestRunCurrentClass Error executing vim.schedule lua callback: ...site/pack/lazy/opt/nvim-java/lua/java/handlers/error.lua:28:
failed to run the current test class
RPC[Error] code_name = MethodNotFound, message = "No delegateCommandHandler for vscode.java.test.findTestTypesAndMethods"
stack traceback:
 ...site/pack/lazy/opt/nvim-java/lua/java/handlers/error.lua:18: in function 'error_handler'
 ...ck/lazy/opt/nvim-java-core/lua/java-core/utils/async.lua:32: in function 'callback'
 ...nvim-java-core/lua/java-core/ls/clients/jdtls-client.lua:72: in function 'handler'
 .../neovim/0.10.1/share/nvim/runtime/lua/vim/lsp/client.lua:687: in function ''
 vim/_editor.lua: in function
stack traceback:
 [C]: in function 'error'
 ...site/pack/lazy/opt/nvim-java/lua/java/handlers/error.lua:28: in function 'error_handler'
 ...ck/lazy/opt/nvim-java-core/lua/java-core/utils/async.lua:32: in function 'callback'
 ...nvim-java-core/lua/java-core/ls/clients/jdtls-client.lua:72: in function 'handler'
 .../neovim/0.10.1/share/nvim/runtime/lua/vim/lsp/client.lua:687: in function ''
 vim/_editor.lua: in function

I have checked and all the plugins have been successfully downloaded, as well as jdtls, java-test and java-debug-adapter.

### Steps To Reproduce

1. Install v2.0.1 of nvim-java
2. Open java file and attempt to run any of the java commands

### Expected Behavior

Expect to see error described in the bug report.

I have the same issue but, the error appears also immediately after the "Configuring DAP" message.

Neovim version (nvim -v)
v0.10.1

Operating system/version
Arch Linux

Any updates along these lines? I started seeing this error in the last 4-5 days.

What are the versions of `java-debug-adapter`, `java-test`, `jdtls` you see in Mason?

I cloned Kickstart yesterday, applied the changes on these 3 commits and got the same error.

FWIW, I was seeing this error when I had the latest jdtls installed (1.41), upon adding `github:nvim-java/mason-registry` to mason registries it installed the ver.1.37 for me which fixed the issue.

I'm also getting the same issue, I can provide details:

### Versions
**Neovim version**
v0.10.2

**Operating system/version**
MacOS Version 15.1

**`java-debug-adapter` version**
0.58.0

**`java-test` version**
 0.40.1
note: this version seems to be locked, since everytime I try to update it will reinstall this exact version

**`jdtls` version**
v1.37.0

**JDK version**
openjdk version "17.0.12" 2024-07-16
OpenJDK Runtime Environment JBR-17.0.12+1-1087.25-jcef (build 17.0.12+1-b1087.25)
OpenJDK 64-Bit Server VM JBR-17.0.12+1-1087.25-jcef (build 17.0.12+1-b1087.25, mixed mode)

I use kickstart.nvim, with similar setup as above but simpler:

 {
 'nvim-java/nvim-java',
 config = function()
 require('java').setup {
 java_debug_adapter = {
 enable = false,
 },
 }
 end,
 },
 {
 'neovim/nvim-lspconfig',
 config = function()
 local servers = {
 jdtls = {},
 }

 require('mason').setup()

 local ensure_installed = vim.tbl_keys(servers or {})
 vim.list_extend(ensure_installed, {
 'stylua', -- Used to format lua code
 })
 require('mason-tool-installer').setup { ensure_installed = ensure_installed }

 require('mason-lspconfig').setup {
 handlers = {
 function(server_name)
 local server = servers[server_name] or {}
 server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
 require('lspconfig')[server_name].setup(server)
 end,
 },
 }
 end
 }

I got this error on opening a java file, even though I already disabled the DAP

# result from :messages
Error executing vim.schedule lua callback: ...al/share/nvim/lazy/nvim-java/lua/java/handlers/error.lua:28:
dap configuration failed
RPC[Error] code_name = MethodNotFound, message = "No delegateCommandHandler for vscode.java.resolveMainClass"
stack traceback:
 ...al/share/nvim/lazy/nvim-java/lua/java/handlers/error.lua:18: in function 'error_handler'
 ...e/nvim/lazy/nvim-java-core/lua/java-core/utils/async.lua:32: in function 'callback'
 ...nvim-java-core/lua/java-core/ls/clients/jdtls-client.lua:72: in function 'handler'
 ...eovim/0.10.2_1/share/nvim/runtime/lua/vim/lsp/client.lua:687: in function ''
 vim/_editor.lua: in function

Hope this clarifies.

Can confirm that this issue still exists after updating to `nvim-java 3.0.0`. Here is my config.

Can you provide details about your system as provided in the post above yours please?

That's insufficient. Please look at the post and provide same details.

Can you try with the handlers in you jdtls setup contented?

I have done recollection about that being changed in Mason.

@ShouryaRSharma this is essentially misplaced:

opts = {
 servers = {
 jdtls = {
 settings = {
 java = {
 configuration = {
 runtimes = {
 {
 name = "JavaSE-17",
 path = "/opt/homebrew/opt/openjdk@17/bin/java",
 default = true
 },
 {
 name = "JavaSE-11",
 path = "/opt/homebrew/opt/openjdk@11/bin/java",
 }
 }
 }
 },
 },
 },
 },
 setup = {
 jdtls = function()
 require("java").setup()
 end,
 },
}

The jdtls table should be passed to nvim-java setup.

@s1n7ax, I'm addressing you since OP is not likely to show up. This issue is a configuration issue and should be closed.

I’m still getting the same error, even though my config looks a little different. I think it’s essentially the same setup.

java.lua

return {
 "nvim-java/nvim-java",
 config = function()
 require("java").setup()
 end,
 dependencies = {
 "neovim/nvim-lspconfig",
 },
}

lsp.lua

return {
 "neovim/nvim-lspconfig",
 dependencies = {
 "stevearc/conform.nvim",
 "williamboman/mason.nvim",
 "williamboman/mason-lspconfig.nvim",
 "hrsh7th/cmp-nvim-lsp",
 "hrsh7th/cmp-buffer",
 "hrsh7th/cmp-path",
 "hrsh7th/cmp-cmdline",
 "hrsh7th/nvim-cmp",
 "L3MON4D3/LuaSnip",
 "saadparwaiz1/cmp_luasnip",
 "j-hui/fidget.nvim",
 },

 config = function()
 local cmp = require("cmp")
 local cmp_lsp = require("cmp_nvim_lsp")
 local capabilities = vim.tbl_deep_extend(
 "force",
 {},
 vim.lsp.protocol.make_client_capabilities(),
 cmp_lsp.default_capabilities()
 )

 require("fidget").setup({})
 require("mason").setup()
 require("mason-lspconfig").setup({
 automatic_enable = {
 exclude = {
 -- "jdtls",
 },
 },
 ensure_installed = {
 "lua_ls",
 "rust_analyzer",
 "gopls",
 "tailwindcss",
 },

 handlers = {
 function(server_name) -- default handler (optional)
 require("lspconfig")[server_name].setup({
 capabilities = capabilities,
 })
 end,

 zls = function()
 local lspconfig = require("lspconfig")
 lspconfig.zls.setup({
 root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"),
 settings = {
 zls = {
 enable_inlay_hints = true,
 enable_snippets = true,
 warn_style = true,
 },
 },
 })
 vim.g.zig_fmt_parse_errors = 0
 vim.g.zig_fmt_autosave = 0
 end,
 -- ["jdtls"] = function()
 -- local lspconfig = require("lspconfig")
 -- lspconfig.jdtls.setup({
 -- capabilities = capabilities,
 -- })
 -- end,
 ["lua_ls"] = function()
 local lspconfig = require("lspconfig")
 lspconfig.lua_ls.setup({
 capabilities = capabilities,
 settings = {
 Lua = {
 format = {
 enable = true,
 -- Put format options here
 -- NOTE: the value should be STRING!!
 defaultConfig = {
 indent_style = "space",
 indent_size = "2",
 },
 },
 },
 },
 })
 end,
 ["tailwindcss"] = function()
 local lspconfig = require("lspconfig")
 lspconfig.tailwindcss.setup({
 capabilities = capabilities,
 filetypes = {
 "html",
 "css",
 "scss",
 "javascript",
 "javascriptreact",
 "typescript",
 "typescriptreact",
 "vue",
 "svelte",
 },
 settings = {
 tailwindCSS = {
 experimental = {
 classRegex = {
 "tw`([^`]*)",
 'tw="([^"]*)',
 'tw={"([^"}]*)',
 "tw\\.\\w+`([^`]*)",
 "tw\\(.*?\\)`([^`]*)",
 },
 },
 },
 },
 })
 end,
 },
 })
...

Error msg

Error executing vim.schedule lua callback: ...al/share/nvim/lazy/nvim-java/lua/java/handlers/error.lua:28:
dap configuration failed
RPC[Error] code_name = MethodNotFound, message = "No delegateCommandHandler for vscode.java.resolveMainClass"
stack traceback:
 ...al/share/nvim/lazy/nvim-java/lua/java/handlers/error.lua:18: in function 'error_handler'
 ...e/nvim/lazy/nvim-java-core/lua/java-core/utils/async.lua:32: in function 'callback'
 ...nvim-java-core/lua/java-core/ls/clients/jdtls-client.lua:74: in function 'handler'
 /usr/share/nvim/runtime/lua/vim/lsp/client.lua:682: in function ''
 vim/_editor.lua: in function
stack traceback:
 [C]: in function 'error'
 ...al/share/nvim/lazy/nvim-java/lua/java/handlers/error.lua:28: in function 'error_handler'
 ...e/nvim/lazy/nvim-java-core/lua/java-core/utils/async.lua:32: in function 'callback'
 ...nvim-java-core/lua/java-core/ls/clients/jdtls-client.lua:74: in function 'handler'
 /usr/share/nvim/runtime/lua/vim/lsp/client.lua:682: in function ''
 vim/_editor.lua: in function

I’ve tried a few different variations of the config. Ultimately, I think the error is coming from mason-lspconfig, but I can’t seem to get it right.


Question: syntax error with phpstan starting with 2.6.7?

Hi, can you please create a small reproducing repository that shows this problem? Thanks.

syntax error with phpstan starting with 2.6.7
I use phpstan in my project and after the update to 2.6.7 phpstan fails with a "syntax error":

 44/44 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ----------------------------------------------------------------------
 Line tests/ApiTest.php
 ------ ----------------------------------------------------------------------
 Internal error: syntax error, unexpected 'static' (T_STATIC)
 Run PHPStan with --debug option and post the stack trace to:
 URL
 ------ ----------------------------------------------------------------------

The internal error is (I'm using php 7.4):

Does anyone know how to work around that?

hm, maybe api-platform should avoid php8-only syntax until php8 is required?

yeah, but phpstan parses all referenced files anyway and then fails. And phpstan doesn't provide a way to skip files before parsing, only after parsing :(

This is enough to trigger the error:

php
<?php

declare(strict_types=1);

namespace App\Tests;

use ApiPlatform\Core\Bridge\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Core\Bridge\Symfony\Bundle\Test\Client;

class Test extends ApiTestCase
{
 protected function setUp(): void
 {
 parent::setUp();
 static::createClient();
 }
}

Since URL says this is a phpstan issue I've opened a bug report with phpstan: URL

This is going to be fixed in PHPStan 1.4.2 which is going to be released soon.

Does not skip code guarded by PHP_VERSION_ID resulting in "Internal error: syntax error"
# Bug report

I'm using api-platform and they have recently started to include php8 only files and guard their uses via `PHP_VERSION_ID` checks. For example:

 URL

which then conditionally includes:

 URL

which is PHP8 only syntax, and fails with PHP 7.4.

Related downstream issue: URL

### Code snippet that reproduces the problem

php
<?php
// composer require api-platform/core phpstan/phpstan symfony/framework-bundle phpunit/phpunit symfony/http-client

declare(strict_types=1);

require_once __DIR__.'/vendor/autoload.php';

use ApiPlatform\Core\Bridge\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Core\Bridge\Symfony\Bundle\Test\Client;

class Test extends ApiTestCase
{
 protected function setUp(): void
 {
 parent::setUp();
 static::createClient();
 }
}

bash
$ php7.4 ./vendor/bin/phpstan analyze a.php
 ------ ----------------------------------------------------------------------
 Line /a.php
 ------ ----------------------------------------------------------------------
 Internal error: syntax error, unexpected 'static' (T_STATIC)
 Run PHPStan with --debug option and post the stack trace to:
 URL
 ------ ----------------------------------------------------------------------

### Expected output

No output

### Did PHPStan help you today? Did it make you happy in any way?

every day :)

Thank you, perfect. I'm gonna look into it in the next few days.


Question: index.html permission denied?

Hey, the way of modifing something for JMP is deprecated.
JMP is using the frontend from the server now.
If you can't see the button. Check if you have the newest version of JMP 1.11.1 and this plugin

index.html permission denied
Jellyfin is installed on TrueNas Scale. Used over Android as well as Windows Devices throughout the House.

Image

I tried the "Windows" Fix by adjusting the Permission of index.html in jellyfin-web for all users on my PC, didn´t do anything for JMP on the Device and obviously not for any phone or whatsoever.

Tried the docker fix but it got too technical for me as im not even sure what exactly a Docker is and over TrueNas Shell for Jellyfin Container i just get docker: not found. I think that means i don´t use dockers?

Image

Any help would be appreciated on how to move forward trying to fix it and please excuse any technical illiteracy on my part

It seems that TrueNAS uses a different approach for file permissions.

What i got from the documentation ( URL
is that you should be able to change permissions for the whole dataset of your jellyfin instance.

Depending on if you have access to the `index.html` yourself you could try to make the necessary changes yourself.
Don't worry you don't have to change much, just insert a line like I described here:
 URL

Please change the version of the line to `1.3.1.0`

Unfortunately, i am not very familiar with TrueNAS and i don't think i can help you further with this issue (of course i will try if i can).
So, if my ideas shouldn't work out, you could ask in r/selfhosted or r/truenas on reddit for help.
There are a lot of smart people in this subreddits and i believe there are many which know way more about the TrueNAS environment

use this docker mod for lsio images URL It fixes the permission.

unable to display the button
Hello, great new idea to navigate faster on jellyfin. At the moment I can't get the button to appear, any ideas? Thanks

Hey guys, I am sorry that you have an issue with the program.
Currently i don't really have the capacity to work at the project right now.
I will try to get some stuff done next week.

It would be nice if you guys could share a little bit more information to track down the problem.
For example, which client are you using, JMP Client or Web version?
If you are using the Web version, could you open up the Browser Console and check if there are any lines that start with
[InPlayerEpisodePreview]
, or any errors (marked red).
In which version of the program did the error occur (V1.0.0.0 or V1.0.1.0).
Does the bug also happen on the previews version?
Are you using the Intro Skipper plugin by any chance?

Hey, thanks for the reply.
I'm using the web interface but I'm currently not home for another week,
I'll send you the logs then.
I'm using the latest version of IPEP, 1.0.1.0, and yes, I'm using the Intro
Skipper plugin.

Le ven. 15 mars 2024, 17:12, Namo ***@***.***> a écrit :

Same as him and also I'm seeing that the plugin is still stuck on version 1.0.0.0 in extensions tabs but won't download the 1.0.1.0 and also by forcing it and doing it manually it's still marked as 1.0.0.0

Hey guys,

I made some changes for the new Jellyfin version.
Would be nice if you guys could give me an update on the appearnce of the button for the new version.

If you are still unable to see the button please check inside the browser console if you can see some messages with the prefix `[InPlayerEpisodePreview]`

after testing the new update on 10.9 on docker, i finally see the the boutton and the console logs of docker show me this

chrome_jy859TINZm
chrome_PWk0Hn55rf

but nothing in the chrome 124 console logs

Ha that is weird that you don't have anything in the chrome logs.
Well glad it works for you now 👍

No luck for me. Chrome still doesn't show logs or button on the latest 10.9

You can check your log files in jellyfin under Home -> Dashboard -> Logs
Have a look if anything comes up if you search for `Loaded assembly "Namo.Plugin.InPlayerEpisodePreview, Version=1.1.0.0`

Damn here I see the issue

Namo.Plugin.InPlayerEpisodePreview.InPlayerEpisodePreviewPlugin: Attempting to inject preview script code in "C:\Program Files\Jellyfin\Server\jellyfin-web\index.html"
[2024-05-13 00:19:08.336 +05:30] [ERR] [104] Namo.Plugin.InPlayerEpisodePreview.InPlayerEpisodePreviewPlugin: Encountered exception while writing to "C:\Program Files\Jellyfin\Server\jellyfin-web\index.html": "System.UnauthorizedAccessException: Access to the path 'C:\Program Files\Jellyfin\Server\jellyfin-web\index.html' is denied.

Here as well

2024-05-13 00:42:49.440 +05:30] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly "Namo.Plugin.InPlayerEpisodePreview, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null" from "C:\ProgramData\Jellyfin\Server\plugins\InPlayerEpisodePreview_1.1.0.0\Namo.Plugin.InPlayerEpisodePreview.dll

Okay yeah seems like the script doesn't have the right permissions.
What you could try to do is editing the index.html yourself.

Check your jellyfin installation for the file.
Inside the file look for a section where ` `

If that doesn't work you may have to find a solution for the write permissions to the file on your system.
I don't think i can change anything about that on the plugin side

[2024-05-14 22:45:48.931 +05:30] [INF] [24] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly "Namo.Plugin.InPlayerEpisodePreview, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null" from "C:\ProgramData\Jellyfin\Server\plugins\InPlayerEpisodePreview_1.1.0.0\Namo.Plugin.InPlayerEpisodePreview.dll"

Did as suggested. Even disabled the custom css, thinking it might be creating issues. No help

Have you checked again if you see anything in the chrome logs (Press F12 -> Go to console, and then start an episode)

Okay, when you are watching a video, could you right click and select "View Page Source".
Then search with Ctrl+F for `/InPlayerPreview/ClientScript`.

In theory you should finde the line you added to your index.html

So normally that line should download the scriptfile from the plugin.
Next thing you could try would be:
- uninstall the plugin (just to be sure)
- download the web-client-script
- copy the js file inside into the folder where your index.html is
- replace the old script line from the plugin with this one:

html

If that isn't working try this line:

html

Remember to restart your jellyfin server in between

I guess mine is an isolated issue. Tried both lines, after uninstalling and multiple restarts. Could'nt get it to show up.

image
image

@Namo2 finally got an error log in the console, hoping this can be a help. BTW the plugin works awesome in the JMP

image

Quickly patched this up.

The dll is the complete plugin. You would need to go in your jellyfin folder then to plugins and open "InPlayerEpisodePreview_1.1.0.0". Just replace the dll inside there with the one from the zip.

If that works hit me up. I would make the changes public then

inPlayerEpisodePreview-1.1.1.0-beta-server.zip

Just a query. Even though on your suggestion, I am using JMP, but some of my users use phone to watch my library. Is changing episode from the prompt on web (since the Android app is a web wrapper) totally not possible and is a code limitation, out just currently not implemented?

I will check how hard it would be to implement but my main focus for the future will be to get this feature/plugin into the official jellyfin version

Does something to combine this PR and your plugin would be possibly cause to button for something similar would really make the UI messy and too much I think.

Thanks for mentioning it.
The plan is to open a discussion for this feature anyway but before i want to rewrite the core of it, so it would be ready for merging. Changes for the UI etc can be discussed then

Changing the write permisions of `Jellyfin\Server\jellyfin-web` worked for me. I granted read and write access to the group `Users ( \Users)` and restarted the server. After that, I could see the button.

Just checked something on android and i saw that the plugin also works there for me (even the episode switching)

Followed this ticket and now it works in Browser but not in JMP... Weird, maybe it just needs time to update?

Hey ye,

do I understand this correctly, the only way this plugin works is by manipulating the `index.html` of Jellyfin?

I'm hosting Jellyfin via Docker in the most common setup, i.e. with individual UID/GID.
In this setup, manipulating the file won't be allowed for the user running Jellyfin with the container's default file permissions.
I think this a reasonable security feature and I'd rather not change the permissions of files inside a readily provided container.

There is no configurable list of scripts that the Jellyfin frontend loads etc. or other means to inject this button?

Same here, Jellyfin-web is installed from Gentoo ebuild (package) and I don’t wish to have to remember to modify the file for each update.

so I have same issue I use latest version of jellyfin and I cant see that preview button in player (web)/desktop

Hey, the error message looks like you would use Jellyfin 10.10.0 (from the unstable) release.
If so, you need to wait for the official 10.10.0 release which is tomorrow as far as i know

Just heard that the official 10.10 release is delayed by ~2 weeks.
I will add a pre-release sometime this day, which could be manually installed

oh! thank you for the tip and yes it would be good. so it works on day one when it get released

I don't think I can get it to work directly on release.
I need to add my github release to the manifest.json you guys are using
and if I do that beforehand, it will automatically update for everyone, even if they're still on 10.9.
So I guess I'll have to do it manually first, but it's usually done the same day.

I think you can specific version for each one if I'm not mistake but yeah i can do the manual way no issue

Oh yeah i think you are right. I never worked with these but maybe i will try it out

here are other manifests i saw, URL and URL and URL so with help of chatgpt and me being patient zero im sure you can manage it so gl!

worst case, host new manifest on different url till it get officially released?

Plugin is working on the browser but not on JMP, from the logs I see this error:
`[ERR] [33] Namo.Plugin.InPlayerEpisodePreview.Api.InPlayerPreviewController: InPlayerEpisodePreviewPlugin: "Namo.Plugin.InPlayerEpisodePreview.Web.InPlayerPreview.js"
`
I already modified my nativeshell.js as instructed in the readme, it used to work fine but not anymore, any ideas?

Even though the button is displayed and working on the web browser, I can see an error on the console:
image

The amount of time this plugin takes to troubleshoot with every jellyfin update is not worth it for me anymore, all other plugins just migrate smoothly with every jellyfin update except this one, nothing have changed from the last time this plugin was working except for the jellyfin version.

Hi, I am having this issue too.
The button appears on the web client (although it still generates this error: [InPlayerEpisodePreview] Couldn't save items from response) but does not appear on the media player, I see that the method for the media player depreciated so shouldn't it appear on the media player if it appears on the web client?

I am on windows and have the latest version of the server, media player and this plugin

yeah that is how it should be. I don't know yet why it happens.
The only thing, that you have to do is restarting the media player after installing the update.
What could also be important is that the media player connects to your server on startup.
If you ever used the old version for JMP removing the changes you made back in the days or better, reinstall the player.

Just for information, are you on Windows 10, 11?
Maybe the version could also be important (e.g. 23H2 or 24H2) for windows 11

before i forget, this error is normal on first initialization (loading/reloading the webpage, starting JMP)
It has to do with the new fetching of data in 10.10.x

When i have time again, i will think about a rework for more stability.
(if i don't work on a native integration)


Question: action button not working and sync error Android 14?

@tomasz-c OK, good point!

Here is what the app currently does:

The first time a watch tries to connect, the app will pair with the watch automatically.
From then on, it will only pair with the same watch until you press the "FORGET" button.
If you try to connect another watch, it will fail.
You can test this by resetting your watch to factory default and trying to connect. This will fail because the Bluetooth ID of the watch changes when reset, equivalent to connecting a new watch. To connect the watch, you must press the "FORGET" button. (Prior to version 11.9, I have gone back and forth allowing all watches to auto-connect because some people have requested auto-syncing multiple watches, but now only one watch can connect until "FORGET" is pressed).

Now, the only way somebody else can connect to the watch is if they are running the app and have not yet paired it with a watch. This can happen when the watch auto-syncs, and they are nearby, like on a bus (a very rare event, I can only hope this app is popular enough for random people to run it on the same bus). In this case, they will not be able to see the Google reminders in the app, but it is possible to send their reminders to your watch, which is, of course, a problem.

Auto-pair is generally a good feature. The app can connect to watches ad-hoc, even if they are not in the supported list. People like this feature, and I would like to keep it.

To address the rare possibility of sending the wrong reminders, I will arrange the app not to send reminders if this is the first time they have connected to this watch.

action button not working and sync error Android 14
The action button doesn't work and I'm only able to connect once, after that I have to forget the watch in the app and connect again.

Steps to reproduce:

1. open app
2. connect watch as instructed
3. all settings sync perfectly
4. disconnect watch by short pressing either mode or 'action' button
5. pressing the action button doesn't do anything
6. try to connect watch again as instructed but watch displays 'ERR' in the top right matrix display after flashing 'CNCT' for 8 times, no reaction from the app
7. press 'forget' in the app and connect watch again
8. app works until watch is disconnected upon which watch won't connect again unless watch is forgotten in app

Expected behavior:

1.- 4. as above
5. pressing action button launches set action
6. watch can be reconnected without having to forget every time

If theres a way to send logs or provide u with other information please let me know.

Devices:
GW-B5600
Pixel 7
Android 14 UQ1A.231205.015
App ver. 12.1

OK, let us establish a baseline for the problem. Let me ask you a few things first:

What is the version of the app? You can find the version by pressing the (i) in the top-right of the initial screen.
Is this a new behavior? Was it working before, or is this something you have experienced before?
Please make sure the official app is not running on your phone or on phones in the proximity of the watch.
Please make sure this app is not running on a phone in the proximity of the watch.
Does the app work on another phone you might have?
Do you have multiple watches?
I will look into the issue once I understand the situation better. Thanks for reporting this.

A simple thing to try is to go the Android setting, and clear "Storage and Cahe" and see if this fixes the promle. In v12.1, we cahnged the way we store local data, this might be effecting it.

If all else fails, somebody reported that they had to pair the watch manually once from the Android settings, and then it started working. We have tested the app with Android 14, so I assumed that this is something specific to their crDroid OS. It seems that some versions of Android 14 have extra security features that don't allow automatic pairing, or there is a bug in the OS. We are still investigating.

If you try to pair manually, go to Settings, select Bluetooth -> Pair new device, then long-press the lower-left button of the watch, and it will appear in the list of devices. Just pair it then

here is the link

Please let me know how it goes.

Just keeping some notes here for future reference:

Location of DataStore data file:
/data/data/org.avmedia.gshockGoogleSync/files/datastore/CASIO_GOOGLE_SYNC_STORAGE.preferences_pb

Simmilar issue found here:
 URL

**[SOLUTION:]**

did that app works as expected now
(cleared cache b4 for good measure)

-----

1. new user
2. no official app installed, no other phones in vicinity
3. "
4. n/a
5. no

-----

same behavior as pressing 'forget' in app

-----

stock pixel rom, however custom linux-stable based kernel
(5.10.197-Kirisakura_Raviantah_2.1.0), magisk 26.4, lsposed 1.9.2; if that matters

Great, thanks for the feedback! I'll add this solution to a troubleshooting section.
I'll continue to investigate why this is the case.i can only assume this is a new security feature to prevent apps from maliciously connecting via Bluetooth without the user's knowledge. It does not effect all Android 14 phones, so I'm not sure what is the difference.

I would be really curious how the official app behaves with your phone, but if you have not installed it before, I understand you might be reluctant to compromise your privacy.

Thanks again for reporting this.

Just tried both the 'classic' g shock connected and newer casio watches app and both work as expected. Once paired in app the watch and app reconnect without hiccup. Deleted the watch pairing from my phones bluetooth settings beforehand.
So I'm guessing it's bug specific to your app.

Ok, I'll look into it. Thanks.

On Sun, Feb 18, 2024, 12:14 PM Lexvox ***@***.***> wrote:

Sounds like you have some good technical skills. Could you help me narrow down the problem?
I suspect it has something to do with the app storage. After connection, the Bluetooth (BT) ID of the watch is stored in the DataStore of the app. Next time, the app will reuse the same ID to connect to the watch until you clear the storage or press "FORGET".

Could you try the following:

1. Unpair the watch and clear storage from Android settings.
2. Set up ADB on your PC. Put your phone in "developer" mode and connect it to the PC via USB.
3. Run the following to see the content of the app's data:

adb shell
run-as org.avmedia.gshockGoogleSync
cat /data/data/org.avmedia.gshockGoogleSync/files/datastore/CASIO_GOOGLE_SYNC_STORAGE.preferences_pb

You should see "File not found".
4. Connect the watch to the phone for the first time. Run the above commands again. This time you should see something like:

LastDeviceName*CASIO GA-B2100
LastDeviceAddress*F6:A1:42:57:7A:07

LastDeviceAddress is what holds the ID of the watch. Let me know if you see it.

Thanks

1. cleared app, deleted pairing from phones bt setting
2. looked up the file (nonexistent)
3. after connecting (in app) it holds my watches id just like in ur xample,
4. disconnected watch
5. wont reconnect as before,
6. without clearing the app or forgetting the watch in app I connected the watch through my phones bt settings and when I switched back to the app the interface was already up displaying the info as expected

also cleared and reconnected twice just to see if the phone changed the id for some reason (it didn't)

Hello @Lexvox

If you are comfortable with it, do you mind building the branch new-ble and testing it with your Android 14? This should address the issue of having to press the "FORGET" button with every connection, without manually pairing the watch.

I replaced my own implementation of the BLE interface with this library. This is supposed to be the "gold standard" when referring to BLE libs, so I hope this fixes the issue.

If you prefer an APK, I can send you to test.

Thanks in advance.

Hi @izivkov

wouldn't mind building it but I'm currently on vacation and don't have my computer with me.
But if you can send me an apk I'll gladly test it.

Oh, sorry to bother you on vacation. Here is the APK, but please don't spend too much time on this, I can get somebody with Android 14 to test it.

I don't mind, not like I'm wasting any beautiful weather here and I enjoy the tinkering :)
Unfortunately after going through initial setup the app crashes about a second after I attempt to connect a second time.
It first reacts to the watch (loading animation plays) but it crashes before the interface comes up.
Yet again the problem is solved by pairing the watch in the device settings first.
I'll send you the crash log via email.

Thanks for the log. I saw this error earlier, and I updated the APK. If you have time, download again give it another try. It does not happen for me. If it deos not work for you, I will post a messages on GitHub regarding this. One of the contributots with Android 12 will try to fix it.

Thanks again
Ivo

Limit syncing to paired watches
**Is your feature request related to a problem? Please describe.**
Currently, the app has something like auto-pairing.
I observed a situation where a watch that was not paired with my smartphone triggered (when trying to sync) my calendar entries to be sent to it.

To repeat this:
Restore to factory settings (or unpair) watches A and B.
We pair watch A with the official Casio app on smartphone 1, watch B with CasioGShockSmartSync on smartphone 2.

Let's turn off the CasioGShockSmartSync app on smartphone 2 (although in my case it was on) and wait for watch A to sync. It connected to smartphone 2, from which the calendar entries (REM) were sent.

Maybe someone with access to two watches and smartphones would be able to confirm this, but it seems to me that this is repeatable.

**Describe the solution you'd like**
It seems to me that there would be a useful option that would allow only watches that were previously paired to sync. Without this, our calendar entries can go to other people, at work, school or on the bus :)

By the way, I wanted to thank you for creating and developing this application.

@tomasz-c The scenario you described in your comment is kind of expected behavior though. If watch A was previously connected to this app, it simply connected to this app again and got reminders from it. The same reminders will show up in the official app.

If you really wanted only watch B to connect to this app, pair it, and do not press the "FORGET" button. Watch A will not connect to the app. This is what should happen in version 11.9 and later of this app. Let me know if this is not what you see.

Generally, I recommend running only one app, not both.

I did some tests with my two watches, GW-B5600 and GAB-2100, and the app worked as expected for me (with some small display issues, which I will fix in the next release). Basically, if the watch is already paired, another watch cannot connect unless the "FORGET" button is pressed. I made a video to ensure we are on the same page:

Watch Connection Video

If you actually connect and are able to get to the TIME screen without forgetting, there may be some problem saving to the LocalStorage of your phone, since the paired watch info is stored there. I'm hoping that this is just a display issue, as shown in the video.

Regards

@tomasz-c Here are a few things to try:
- Make sure you have all permissions for the app enabled, especially read/write permissions.
- Try using a different phone with the two watches. This will eliminate the posibility that the problem is related to the phone setting/Android version.
- Regards

I will check it and let you know.
Currently, I have recorded a video of how the application behaves on my smartphone, so I am sharing it:
 URL

I will check it and let you know. Currently, I have recorded a video of how the application behaves on my smartphone, so I am sharing it:

The application is launched immediately after clearing the data.
0:03 - information about the program, with visible version,
0:13 - GST-B500 pairing
0:23 - disconnected
0:32 - MSG-B100 pairing
0:43 - disconnected
0:50 - GST-B500 pairing
0:56 - disconnected

I didn't use FORGET here.
This is Android 14, tested on the v12.0 app from Fdroid and Google Play.
By the way. If you release a new official version, would it be possible to include on GitHub the apk there in addition to the source code, as other projects do? This would allow to test new versions quickly.

Regards

On Android 10 with your application, this situation does not occur, the second watch does not pair, it has ERR.
After restarting the application, I can pair the second watch without using FORGET, but this is probably intentional.

On Android 14, there is no read/write access (data access) in the permission settings, so you can't grant it even manually. On Android 10 this is possible. So I guess you had a good idea to check it out.
I don't know which Android version you are using, maybe it's due to a change: URL

OK, thanks for helping thack this issue. I will look into getting it to work with Adroid 14, and aslo making other small fixes. Should take a couple of days.

So, looks like the Android Version is not causing the problem. I ran the app with an Android 14 emulator (Pixel 3a API 34), and I can read and write from local storage.
Which phone make and model are you using?

I'm using OnePlus 6 running crDroid which is based on LineageOS.

I checked the application in App Manager and there are two permissions with data access and the status "revoked", even though in the application settings I have the status "No permissions denied":

Screenshot_20240207-180348_Permission controller
Screenshot_20240207-173557_App Manager

I added permissions manually via adb:

adb shell pm grant org.avmedia.gshockGoogleSync android.permission.READ_EXTERNAL_STORAGE
adb shell pm grant org.avmedia.gshockGoogleSync android.permission.WRITE_EXTERNAL_STORAGE

They appeared in App Manager (granted):

Screenshot_20240207-173557_App Manager

But it didn't help and the application works the same.

Unfortunately, I cannot check it on another smartphone with Android 14.
I understand that since I have an unofficial Android installation, there may be a problem here somewhere, but overall crDroid works very well for me and I haven't had any problems with it.

So we'll probably have to stop looking for the cause until someone else is able to confirm it on stock Android 14.

Regards

OK, np.
I noticed that in your "TIME" screen, the tempearure is formatted incorrecly, simething like "24 st C" as opposed to "24°C. I'm using localization and have not hardcoded this simbol. Maybe you know if this is specific to the Polish language on Android. I could not find anything related to thes issue on the internet.

Yes, that's a shortcut. Anyone would understand it, but it's not commonly used and looks a bit strange. Maybe someone uses it in some literary (non-technical) texts. I think it would be better to use °C. I have no idea why Android shows it this way for the Polish language. In Android battery settings and in the weather on the screen, the temperature is given as °C. So it looks like Android itself is not using its interpretation.

@tomasz-c I have updated the app to use DataStore instead of SharedPreferences. I think this will address the problem you are experincing on your Android 14 phone, and also is the recommenerd method to use now. You might want to give it a try, and let me know how it goes

I have placed the APK on my Google Drive, since I have not figured out how to build an APK on GitHub. The code for the APK is in branch "pairing", if you like to build it from source. (If you are familiar with creating APK's on GitHub, feel free to contribute)

This branch also fixes a number of display issues, as well as closing the loophole of getting the incorrect reminders for unpaired watches.

I will do some more testing as well, and if there are not issues, I will merge to main and create another relase.

Cheers,
Ivo

Thank you very much. I'd like to test it, but I can't download this file from Google Drive, is it marked as private?

OK, try again to download. here is the link:
 URL

On Sun, Feb 11, 2024 at 9:37 AM Tomasz C. ***@***.***> wrote:

It works! Now on Android 14 without using 'FORGET' the second watch is unable to pair, it displays 'ERR'.

When it comes to building Android applications, I have no experience. I thought you could just attach an APK file you built yourself, e.g. the one for Google Play. But I read the article and it looks like it's not that easy:
 URL

Thank you for this change in the program. It will be useful in the future when more users will have newer Androids.

Ok, great! Did you notice if your selected actions were preserved after the
update?

I have created a new version 12.1 on playstote and on f-droid. I know it
takes a while to appear on f-droid.

About the APK creation on GitHub, I had it working at one time, but the
signature was not updated properly, so people had to remove the app before
installing it. I simply have to spend the time to write the correct yml
script for GitHub, and I not overly excited about administration work.

On Sun, Feb 11, 2024, 2:13 PM Tomasz C. ***@***.***> wrote:

Yes, I noticed a problem, I edited the previous comment, you probably already replied and didn't see it. Please take a look at them.

No, should not have to use FORGET to connect the same watch. Is this behavior only on your Android 14 phone? BTW, I don't think it is the Android version, but the os distribution.

The app 12.1 should be coming on the playstote soon, maybe try it and see any difference

Strange, I'll try with more phones. Seems like the new settings are not saved. I think the os you're using is super secure.

Can you try this:
- Select some actions in the action screen.
- go to the time screen
- disconnect and restart the app
- see if the newly selected actions are still selected.
This will tell is if you are able to save your preference

Or maybe it has something to do with encryption. Can you put a phone number
in the action screen, restart the app, and see if the number appears the
same?

Thanks

On Sun, Feb 11, 2024, 2:29 PM Tomasz C. ***@***.***> wrote:

I did some tests:
- there is no entry in the application. phone and settings are remembered after restart,
- I built version 12.1, I don't know if I did it correctly, but I got app-debug.apk, it works and presents itself as 12.1, but this version works the same as the previous one,
- the most important observation - if I pair the watch in the Android system settings, I can reconnect without using 'FORGET', both after disconnecting the watch and restarting the application. So after pairing in the system, everything in the application seems to work correctly (I haven't tested automatic time synchronization yet)

I hope that such pairing in the system was not always required and I did not know about it. But probably not, because previously the app connected to all watches every time without pairing in the system.

I forgot to mention that I have Android without Gapps (I did not install it), so I do not have GSF (Google Services Framework), but this application in the Google Play store does not show that it is dependent on GSF.

Conclusion:
- currently (after pairing in the system) the application seems to work as expected, I will let you know if the watch synchronizes automatically,
- this action is fine for me, it doesn't bother me that I have to pair the watch in the system, unless there are some negative consequences that I don't know about,

Thank you for these changes to the application.
Regards.

OK, will leave it for now. I think it is some permissions related to BT for your device.

In the future, I will try ti install crDroid 14 on one of my phones and see if I can reproduce it.

I will leave this issue open in case somebody else want to chime in.

Thanks for all the feedback

Automatic time synchronization does not work. I waited for the watch to want to update, then it was visible that it was connecting and after a short while it displayed ERR. Connecting (bottom left button) and triggering actions (bottom right button) work properly, e.g. sending time to the watch.
I have no more ideas why it doesn't work for me. I will wait until you or someone else has access to Android 14. Not necessarily crDroid, just information that it works properly on any Android 14 is enough, then I will know that it is definitely something on my side.

I don't even have the official app on this phone. But it was running on another phone nearby. I will check synchronization if there is no official application nearby and let you know.
Thank you for your suggestion.

You're right! I set the watch to an hour just before the update, and if there was no other phone with the official application nearby, the synchronization worked :)
Thank you for the idea. I thought that if each watch is paired with its application on separate phones, there will be no conflict.

What has happened is that the watch is sending a signal that it is trying
to connect, and the app running on the phones nearby see this request and
they try to connect to the watch. The first phone that replies to the watch
wins. The watch will only talk to this phone from that point on. In your
case, the phone that was not paired got in first, and that connection
failed. The watch displayed ERR.

On Mon, Feb 12, 2024 at 5:01 PM Tomasz C. ***@***.***> wrote:

Just keeping some notes about this issue for future reference.

Location of DataStore data file:
/data/data/org.avmedia.gshockGoogleSync/files/datastore/CASIO_GOOGLE_SYNC_STORAGE.preferences_pb

Simmilar issue found here:
 URL

@tomasz-c
If you are comfortable with it, do you mind building the branch new-ble and testing it with your Android 14? This should address the issue of having to press the "FORGET" button with every connection, without manually pairing the watch.

I replaced my own implementation of the BLE interface with this library. This is supposed to be the "gold standard" when referring to BLE libs, so I hope this fixes the issue.

Note that this was a massive change, so you may encounter some small issues. I have seen the alarm screen display only 4 alarms instead of 5, but this is rare, and I cannot reproduce it now.

Thanks for your help in advance.

@izivkov
Of course, I was happy to test it. I was only able to do it now, so I checked the latest version 12.4.
- if the watch is paired in the Android configuration, everything seems to work properly,
- if my watch is unpaired and I use FORGET after the first and next connections, everything works fine,
- if I do not use FORGET after the first connection, when I try to connect for the second time, the application crashes with the error:

time: 1709332930999
msg: java.lang.NullPointerException: getName(...) must not be null
stacktrace: java.lang.NullPointerException: getName(...) must not be null
 at org.avmedia.gshockapi.ble.GShockManagerImpl.isRequiredServiceSupported(IGShockManager.kt:161)
 at no.nordicsemi.android.ble.BleManagerHandler$4.onServicesDiscovered(BleManagerHandler.java:2282)
 at android.bluetooth.BluetoothGatt$1$5.run(BluetoothGatt.java:406)
 at android.os.Handler.handleCallback(Handler.java:958)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loopOnce(Looper.java:205)
 at android.os.Looper.loop(Looper.java:294)
 at android.app.ActivityThread.main(ActivityThread.java:8244)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

Please keep in mind that I am using a custom ROM based on LineageOS. There have also been some recent changes with Bluetooth here:

So maybe it's worth having someone else test it on the Android 14 stock ROM before taking any steps.
If you need to test the application, let me know.

Regards,

Great, this is reality helpful. I'll check the crash report, and will keep
you posted.

Ivo

On Fri, Mar 1, 2024, 6:02 PM Tomasz C. ***@***.***> wrote:

Yeah, the code I'm using is right out of the library's example. I know
other people with Android 14 are having issues, but not sure if they are
the same issues. On the other hand, I looked at the statistics for the app,
and there are quite a few Android 14 devices, and I don't see any crashes.
But in any case, I'll do some more digging. Let me know if you find
something as well.

Regards

On Fri, Mar 1, 2024 at 6:06 PM Ivo Zivkov ***@***.***> wrote:

I'm having the same issue with auto time adjustment, but I do have the official app installed, what steps do I take to make sure it works properly?

- First make sure the official app is not running. You can shut it down
from the the Android settings -> Applications.

- Test that time settings work manually. Set action "set time" and trigger
it by short-pressing the lower-right button. If that works, the automatic
time setting should work. There is no difference to the app how time
setting was triggered.

- Also, the app should be running when auto time sync takes place. It can
be in the background, but still running. Sometimes, Android will swap it
out of memory. What this means is that if you started the app within a few
hours of auto sync, this should work.

Hope this helps, and let me know if it works for you.

Ivo

On Mon, Apr 1, 2024, 10:21 AM ppsasho ***@***.***> wrote:

I think there should be at least 6 hours from last time set (manually or
automatic) for the automatic action to trigger.

On Mon, Apr 1, 2024, 10:40 AM ppsasho ***@***.***> wrote:

I'm not syncing it on purpose to see if it auto syncs, I'm on a POCO X3 PRO - version MIUI 13. I gave the app all necessary permissions to run in the background, removed it from battery restrictions and also used: IMG_20240401_112331.jpg

 the app lock feature on MIUI that doesn't let it get closed. Also noticed when trying to change the minutes when it will sync it always goes back to 5 minutes when I Re-connect.

So, just to understand, is the auto time adjustment triggered and gets an error, or not triggered at all? If it is triggered, there is something else interfering with the connection, like the official app.

About settings the minutes, there maybe a small input bug, which I'll fix in the next release. After entering the number, touch the field again, to stop the blinking cursor. Then send to watch.

I actually checked my apps and forgot I deleted the official app so I hope interference is not the issue, But in the past when It tried to auto sync I would see the watch trying to pair with the phone, failing and leaving an error on the display for a moment. I'm waiting for the auto time to adjust and see if I get an error this time without the app.

Ok, seems like there is a problem setting the time to adjust value. It worked for me during testing, but not working at the moment. I'll have to investigate further. I plan to have another release around apr. 20th.

I just got a notification, it connected flawlessly, I'm so glad it worked 😁

👍

On Mon, Apr 1, 2024, 12:12 PM ppsasho ***@***.***> wrote: