Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot filter time entries based on my own user #203

Open
EVA-VictorMalherbe opened this issue Jan 27, 2025 · 10 comments
Open

Cannot filter time entries based on my own user #203

EVA-VictorMalherbe opened this issue Jan 27, 2025 · 10 comments

Comments

@EVA-VictorMalherbe
Copy link

When attempting to filter by user, I can filter time entries of other users but not my own.

This applies both on the dashboard:

Image

Image

and in the report section:

Image

Image

@EVA-VictorMalherbe
Copy link
Author

I am running version 0.3.16 on a self-hosted Nextcloud 30.0.5.

@te-online
Copy link
Owner

That’s strange! Thanks for reporting.

Is it possible that it just doesn’t find your display name? Have you tried searching for your username?

@EVA-VictorMalherbe
Copy link
Author

Thank you for your reply and for this very useful software.

My display name and username are identical. Trying the email address tied with the user account yields the same results.

@te-online
Copy link
Owner

Okay, that sounds like a bug! Let me see if I can reproduce it.

@te-online
Copy link
Owner

Both components are using a Nextcloud API to retrieve the list of people there. So either that one is broken for you or I'm using it wrong.

@EVA-VictorMalherbe Are you familiar with doing http-requests? If so, can you check if you can get this endpoint to give you a correct result on your Nextcloud:

https://{{ YOUR_DOMAIN }}/ocs/v2.php/apps/files_sharing/api/v1/sharees?search={{ YOUR_SEARCH_INPUT }}&format=json&perPage=20&itemType=[0]

For example, if I match my username exactly on my Nextcloud (29), it gives me this response:
Image

@te-online
Copy link
Owner

You can also just check the requests in the browsers DevTools in the "Network" tab. The response also has a users property next to the exact property. Maybe this gives you a clue for how to search for your specific user. And that could give us a clue on how to fix this issue.

@EVA-VictorMalherbe
Copy link
Author

Unfortunately I'm not familiar with doing http-requests. I get a "412 Precondition failed" error in the Network panel.

The page itself displays "Unauthorized access" and "CSRF check failed".

@te-online
Copy link
Owner

Unfortunately I'm not familiar with doing http-requests.

That's okay.

The page itself displays "Unauthorized access" and "CSRF check failed".

Yes, that's true, you can't just open the link in a browser, because it's missing some headers.

I get a "412 Precondition failed" error in the Network panel.

Is that only when you open it directly or also when you open the Network panel when you are in your Nextcloud and on the reports page, for example? You should see a new request whenever you type in the user search field.

@EVA-VictorMalherbe
Copy link
Author

EVA-VictorMalherbe commented Jan 29, 2025

Hi again, I misunderstood your instructions at first, thank you for your further explanations. Observing the request on the page, here is the response:

{
	"ocs": {
		"meta": {
			"status": "ok",
			"statuscode": 200,
			"message": "OK"
		},
		"data": {
			"exact": {
				"users": [
					{
						"label": "Victor Malherbe",
						"icon": "icon-user",
						"subline": "",
						"value": {
							"shareType": 0,
							"shareWith": "Victor Malherbe"
						},
						"shareWithDisplayNameUnique": "...",
						"status": []
					}
				],
				"groups": [],
				"remotes": [],
				"remote_groups": [],
				"emails": [],
				"circles": [],
				"rooms": []
			},
			"users": [],
			"groups": [],
			"remotes": [],
			"remote_groups": [],
			"emails": [],
			"lookup": [],
			"circles": [],
			"rooms": [],
			"lookupEnabled": true
		}
	}
}

Which seems the same response as the one I get for my colleague. Furthermore, testing further if I press enter with my username written in whole, the filter works and shows only my entries. However, there are no suggestions for my user until it is completely written in, contrary to other users.

The response to the first part of my name

{
	"ocs": {
		"meta": {
			"status": "ok",
			"statuscode": 200,
			"message": "OK"
		},
		"data": {
			"exact": {
				"users": [],
				"groups": [],
				"remotes": [],
				"remote_groups": [],
				"emails": [],
				"circles": [],
				"rooms": []
			},
			"users": [],
			"groups": [],
			"remotes": [],
			"remote_groups": [],
			"emails": [],
			"lookup": [],
			"circles": [],
			"rooms": [],
			"lookupEnabled": true
		}
	}
}

Which contrast to the result with the first part of my colleague's name:

{
	"ocs": {
		"meta": {
			"status": "ok",
			"statuscode": 200,
			"message": "OK"
		},
		"data": {
			"exact": {
				"users": [],
				"groups": [],
				"remotes": [],
				"remote_groups": [],
				"emails": [],
				"circles": [],
				"rooms": []
			},
			"users": [
				{
					"label": "Virginie Le Naour",
					"subline": "",
					"icon": "icon-user",
					"value": {
						"shareType": 0,
						"shareWith": "Virginie Le Naour"
					},
					"shareWithDisplayNameUnique": "...",
					"status": {
						"status": "away",
						"message": null,
						"icon": null,
						"clearAt": null
					}
				}
			],
			"groups": [],
			"remotes": [],
			"remote_groups": [],
			"emails": [],
			"lookup": [],
			"circles": [],
			"rooms": [],
			"lookupEnabled": true
		}
	}
}

I hope this is useful. Knowing this I can filter my data adequately for the moment, although it would be nice to figure out why the autofilling isn't working properly.

@te-online
Copy link
Owner

Yes, that is strange! I think it also does that for me, though. Maybe some privacy setting? I may need to switch to a newer API as well... Glad you solved it for now. I'll keep this open for a bit in case I come up with a solution 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants